Rankings Order
https://codeforces.com/group/cRJbcAFEwS/contest/485694/problem/C
Question
Abby and Cody want to make a new website called Abakoda, where beginner programmers can join friendly programming contests and improve their skills.
Now they are working on displaying the contest rankings. They need to display the contestants ordered by rank.
Abby
400
100
100
100
100
Cody
300
100
100
100
0
Aba
200
100
0
100
0
Koda
100
100
0
0
0
Solved By
4
2
3
1
Abby and Cody need your help. They already wrote code that displays the name and total score of each contestant. Write a program that displays the names in order, from highest to lowest score. Ties are broken by alphabetical order: the contestant whose name comes first by alphabetical order gets shown first.
Input Format
The input contains several lines.
The first line of input contains one integer n, the number of contestants.
This is followed by n lines of input. Each of these lines contains a name and a score, separated by a space, representing the name and score of a single contestant. The name contains only lowercase English letters, no spaces, and no punctuation marks. Each name contains at least one letter. The score is one of the following: , , , , or .
Constraints
No two contestants have the same name.
The length of each name does not exceed 10.
Output Format
Your program must print lines of output. Each line must contain a name and a score, in that order, separated by a space. These lines must contain the same data as in the input but in the right order.
Sample Inputs:
Last updated