-->
当前位置:首页 > 题库

PROGRAMMING:Awards ranking

Luz5年前 (2021-05-10)题库414
The first program design competition uses PTA platform, competitors can view their ranking and results in real time through the ranking. The awards of the competition are as follows: the number of first prize, second prize, third prize and excellent prize is 5%, 10%, 20% and 30% of the participants respectively. For example, if the number of participants is 57, the number of first prize, second prize, third prize and excellent prize is 2, 5, 11 and 17 respectively. After the competition, contestants want to check their awards immediately. Please re display the ranking list through programming. You can not only see the ranking and results of all competitors, but also see the information of awards.
###Input format:
Enter a positive integer n (20 ≤ n ≤ 100) in the first line to represent the number of participants, and then enter n lines. Each line gives each participant's admission number and score, and is divided by spaces. The admission number is a 15 digit string in the form of "lyu2018090601", and the score is a positive integer.
###Output format:
According to the order of ranking from high to low, output all the contestants' information. One contestant's information takes up one line, including the position, admission number, results and awards. The middle is divided by spaces. Ranking from high to low is 1, 2, 3,..., and so on. The first prize, the second prize, the third prize and the excellent prize are indicated by the numbers 1, 2, 3 and 4 respectively. No prize is output 0. All the questions are different.
###Input example:
```in
thirty-six
lyu201309290406 194
lyu201409300205 74
lyu201409300229 191
lyu201509010102 67
lyu201509010602 172
lyu201509090223 34
lyu201509100425 21
lyu201509230239 66
lyu201509310201 169
lyu201509310223 60
lyu201609000503 142
lyu201609060103 146
lyu201609060105 55
lyu201609100301 9
lyu201709000415 79
lyu201709000416 49
lyu201709000504 106
lyu201709000505 147
lyu201709040103 177
lyu201709040104 163
lyu201709040110 116
lyu201709090109 38
lyu201709090111 29
lyu201709090726 112
lyu201709100313 130
lyu201709100625 108
lyu201809000118 189
lyu201809000238 127
lyu201809040321 3
lyu201809150107 100
lyu201809150121 35
lyu201809150125 10
lyu201809150126 30
lyu201809150128 23
lyu201809150129 18
lyu201809150326 119
```
###Output example:
```out
1 lyu201309290406 194 1
2 lyu201409300229 191 2
3 lyu201809000118 189 2
4 lyu201709040103 177 2
5 lyu201509010602 172 3
6 lyu201509310201 169 3
7 lyu201709040104 163 3
8 lyu201709000505 147 3
9 lyu201609060103 146 3
10 lyu201609000503 142 3
11 lyu201709100313 130 3
12 lyu201809000238 127 4
13 lyu201809150326 119 4
14 lyu201709040110 116 4
15 lyu201709090726 112 4
16 lyu201709100625 108 4
17 lyu201709000504 106 4
18 lyu201809150107 100 4
19 lyu201709000415 79 4
20 lyu201409300205 74 4
21 lyu201509010102 67 4
22 lyu201509230239 66 0
23 lyu201509310223 60 0
24 lyu201609060105 55 0
25 lyu201709000416 49 0
26 lyu201709090109 38 0
27 lyu201809150121 35 0
28 lyu201509090223 34 0
29 lyu201809150126 30 0
30 lyu201709090111 29 0
31 lyu201809150128 23 0
32 lyu201509100425 21 0
33 lyu201809150129 18 0
34 lyu201809150125 10 0
35 lyu201609100301 9 0
36 lyu201809040321 3 0
```







answer:If there is no answer, please comment