
排序
文章平均质量分 50
yuanba_xs
分享程序员的体会与知识
展开
-
hdu1236排序水题
今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考生,并将他们的成绩按降序打印。Input测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 以下N行,每行给出一名考生的准考证号(长度不超过20的字符串)、该生解决的题目总数m、以原创 2017-02-08 17:53:45 · 383 阅读 · 0 评论 -
CF699A
There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line an原创 2017-02-08 22:26:50 · 1351 阅读 · 0 评论 -
CF558A
Amr lives in Lala Land. Lala Land is a very beautiful country that is located on acoordinate line. Lala Land is famous with its apple trees growing everywhere.Lala Land has exactly n apple trees原创 2017-02-08 22:34:35 · 280 阅读 · 0 评论 -
poj2623求中位数,注意溢出
/*题意:给n个正整数,求他们的中位数,它们的大小小于2^32 - 1(就因为没仔细思考这句话,wa到怀疑人生)思路:排序分奇偶求中位数即可,但是要避免大数相加溢出。*/#include #include #define N 250005using namespace std;int a[N];int main(){ int n; while (~scanf("%d"原创 2017-02-08 22:57:10 · 407 阅读 · 0 评论 -
poj1723 中位数的应用
N soldiers of the land Gridland are randomly scattered around the country.A position in Gridland is given by a pair (x,y) of integer coordinates. Soldiers can move - in one move, one soldier can g原创 2017-02-08 23:31:39 · 600 阅读 · 0 评论 -
CF:609C
In the school computer room there are n servers which are responsible for processing several computing tasks.You know the number of scheduled tasks for each server: there are mi tasks assigned to th原创 2017-02-09 10:41:33 · 355 阅读 · 0 评论 -
poj1731输出不重复全排列
已知一个序列,输出它的不重复全排列思路1.stl应用:next_permutation函数对数组输出全排列,原理每次改变当前字符串变为,大小恰好原来大一阶的序列。若已为最大序列,返回0。说明:next_permutation,重新排列范围内的元素[第一,最后一个)返回按照字典序排列的下一个值较大的组合。返回值:如果有一个更高的排列,它重新排列元素,并返回true;如果这是不可能原创 2017-02-08 18:54:19 · 670 阅读 · 0 评论