Leaderboard
Level B. Teaches records, reading a list of records and sort(by:).
There are n players (1 ≤ n ≤ 1000). Each has a name (lowercase letters, at most 10) and a score from 0 to 100. Print the leaderboard: highest score first, and players with the same score in alphabetical order of name. Each line is the place (1, 2, 3, …; tied players still get consecutive places), a dot, the name and the score.
Input: n, then n lines name score. Output: n lines.
| Input | Output |
|---|---|
4ana 30bo 50cy 30dee 10 | 1. bo 502. ana 303. cy 304. dee 10 |
5 tests · Ctrl+Enter