现在的位置: 首页 > 综合 > 正文

USTC 1122 Millionaire Rank List

2013年10月08日 ⁄ 综合 ⁄ 共 1616字 ⁄ 字号 评论关闭
Millionaire Rank List
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 1025.

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
来源:34th ACM/ICPC Asia Regional, Hefei, Preliminary
解题:
大数排序问题。对于涉及到大数的,一般用c语言读取比较快。排序方法的选择,只需要排列前十个。

抱歉!评论已关闭.