排序
「已注销」
这个作者很懒,什么都没留下…
展开
-
Problem A 排序(难度1)
Problem A: 排序(难度:1) Description 输入三个整数,从小到大排序后输出。 Input 三个整数。 Output 从小到大排序输出这三个整数。 Sample Input 1 2 3 Sample Output 1 2 3 HINT #include #include int main() { int i,j,n,num[10000原创 2017-10-21 08:58:14 · 443 阅读 · 0 评论 -
丑数
Ugly Numbers Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ... shows the first 10 ugly numbers. By convention, 1 is included. Giv原创 2017-10-22 09:46:03 · 196 阅读 · 0 评论 -
poj-1007 DNA sorting
F - DNA Sorting One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', t原创 2017-10-22 09:44:39 · 218 阅读 · 0 评论 -
Building designing
E - Building designing 题目:有n个绝对值不为0的数字,从中找到一个序列,正负交替,绝对值递增,求序列最大长度。 #include #include #include using namespace std; int a[800008]; int cmp(int q,int w) { return fabs(q)>fabs(w);原创 2017-10-22 09:43:28 · 280 阅读 · 0 评论 -
Where is the Marble
Where is the Marble? Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another i原创 2017-10-22 09:43:00 · 255 阅读 · 0 评论 -
sloving order
B - Solving Order Welcome to HDU to take part in the first CCPC girls' competition! As a pretty special competition, many volunteers are preparing for it with high enthusiasm. One thing t原创 2017-10-22 09:41:56 · 559 阅读 · 0 评论 -
sort
给你n个整数,请按从大到小的顺序输出其中前m大的数。 Input 每组测试数据有两行,第一行有两个数n,m(0 的整数。 Output 对每组测试数据按从大到小的顺序输出前m大的数。 Sample Input 5 3 3 -35 92 213 -644 Sample Output 213 92 3 #include #include using原创 2017-10-22 09:41:21 · 491 阅读 · 0 评论 -
比较大小
Problem N: 比较大小 Time Limit: 1 Sec Memory Limit: 128 MB Description 输入两个数,第一个数为 a,第二个数为 b,比较二者大小。 Input 输 入 a 和 b(a 和 b 可 以 是 整 数 、 小 数 或 分 数 形 式 )(-1000 Output 若 a Sample Input 5.2 78/5原创 2017-10-22 09:39:41 · 698 阅读 · 0 评论 -
Problem H 排序练习01(难度5)
Problem H: 排序练习01(难度5) Description 相比普通的排序大家都做的比较厌烦了,那么这次就来道不普通的题。给你一些数,你所需要做的是把这些数按照个位数的大小从大到小排序,如果个位一样则看十位,如果十位还一样则看百位,以此类推。 Input 输入数据第一行有一个 T ,代表着输入数据有 T 组, 每组数据包含一个数字 N(N ) 和 N 个数,原创 2017-10-21 09:03:21 · 415 阅读 · 0 评论 -
Problem G 排序练习00(难度5)
Problem G: 排序练习00(难度:5) Description 话说前面的排序太简单了, 没有丝毫的挑战性, 如今给你 N 个整数, 除了要排序之外, 还要知道每个数原来的位置. Input 输入数据有多组, 每组数据第一行包含一个数字 N( 0 ), 代表有 N 个整数, 第二行紧跟着输入 N 个数. Output 对于每组输入,输出数据有两行,第一行代原创 2017-10-21 09:02:31 · 333 阅读 · 0 评论 -
Problem F 排序(难度4)
Problem F: 排序(难度:4) Description 给你n(1)个数字。每两个数字相减可以得到两个数字,把最终得到的n*(n-1)个数字从小到大排序后输出。 eg.: 2 1 2 1 - 2 = -1,2 - 1 = 1。 两个数字1和2,可以得到-1和1. Input 第一行:n 第二行:n个整数。 Output 按照题意在一行输出结果。 Sample原创 2017-10-21 09:01:46 · 296 阅读 · 0 评论 -
Problem E 排序(难度4)
Problem E: 排序(难度:4) Description 给你n(n > 1)个小写字母,按照字母升序排序后输出。 Input 第一行:n 第二行:n个小写字母。 Output 输出包括两行: 若n为偶数,两行各有n个字母排序后 一半的字母。 若n为奇数,第一行比第二行多一个字母。 Sample Input 5 e d c b a Sample Output原创 2017-10-21 09:01:08 · 636 阅读 · 0 评论 -
Problem D: 排序(难度:3)
Problem D: 排序(难度:3) Description 给你n个小写字母,按照字母升序排列后输出。 Input 第一行:n 第二行:n个小写字母,每两个中间以一个空格隔开。 Output 按照升序排序后输出。 Sample Input 3 c b a Sample Output a b c HINT #include #include int main(原创 2017-10-21 08:59:58 · 488 阅读 · 0 评论 -
Problem C 排序(难度2)
Problem C: 排序(难度:2) Description 给你n个数字,对这些数字从小到大排序并输出。 Input 第一行:n 第二行:n个数字。 Output 输出一行为n个数字从小到大输出,小数点后保留两位小数。 Sample Input 5 1 2 3 4 5 Sample Output 1.00 2.00 3.00 4.00 5.00 HINT #in原创 2017-10-21 08:59:32 · 319 阅读 · 0 评论 -
Problem B 排序(难度3)
Problem B: 排序(难度:3) Description 输入包括5个数字,从小到大排序后输出。 Input 5个数字包括分数和小数和整数。 分数表示形式举例:1/2。 Output 从小到大排序后统一以小数形式保留两位小数输出。 Sample Input 0 1/1 2 3 4 Sample Output 0.00 1.00 2.00 3.00 4.00 HIN原创 2017-10-21 08:58:51 · 304 阅读 · 0 评论 -
hdu-1128 自私的数
Self Numbers In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d原创 2017-10-22 09:51:23 · 284 阅读 · 0 评论