传送门:http://acm.ustc.edu.cn/ustcoj/problem.php?id=1122
Time Limit: 1000ms
Memory Limit: 131072kb
Description
In the wild universe, there lives a race of clever creature. They have high level civilization and control a lot of planets.
As we human, some of us are very rich and the public like to know who are the Top 10. As a journalist of a famous new paper, you are asked to write a program to get the top 10 list.
Input
The input contains only one test case.
The first line contains one integer N (10 <= N <= 1,000,000), which means there are N rich people in the race. The following N lines each contains a integer Mi (Mi >= 0), which means the money of the i-th person.
But as they are universal millionaires, they are very rich, which means the amount of their money can be as large as 10^25.【强迫症要说一下这里我加了一个符号
Note that Mi may have preceding zeros.
Output
Output 10 lines, containing the money of the richest 10 people in descending order. Delete the preceding zeros if they once have.
Sample Input
11
1
2
3
4
5
6
7
8
9
10
15
Sample Output
15
10
9
8
7
6
5
4
3
2
题目大意:把最大的10个数找出来
坑点:they are VERY rich, which means the amount of their money can be as large as 10^25,而且还有前导零
思路:大数+部分排序
嘛。。今天上课老师说了这个08年的合肥赛区【弱校专场2333【final的学校不能参加,题目戳我萌点不知道是怎么回事!于是就滚来做了
5号去找小光聊了个天,最近任务大概就下来了QAQ做好【首先得做得出来】之后要挂学校网站上供老师下载好紧张啊2333做不好老师不满意的话哈哈哈哈哈哈反正先等任务下来吧。。现在三层架构都有点混乱不过还好能建起来的地步,15号就是下周五漫展好激动啊卧槽!又能见到小伙伴了!又要见到比我小得多的coser了好紧张啊哈哈哈哈哈哈小学生说我小哈哈哈哈哈哈展子穿浴衣好厚一定会热成狗QAQ
顺便说一下!今天寝室买的洗衣机到了好棒!!!我和竹竹千辛万苦总算…还是不能用,水龙头太粗了插不进进水管2333
看我扯蛋好玩么?
#include
#include
#include
#include
using namespace std;
string m[1000000];
bool cmp(string a,string b)
{
int i,lenA=a.length(),lenB=b.length();
if(lenA!=lenB)
return lenA>lenB;
for(i=0;ib[i];
}
}
int main()
{
int n,i,cnt;
char temp[30];
scanf("%d",&n);
for(i=0;i