Problem list
Log in
#r03356 · Online Judge > GoldOJ

Sort Students by Score

Silver V 2.0 s 1024 MB

Sort students by decreasing score; ties broken by ascending name. Print each student's name and score.

Input

First line $n$; then $n$ lines each with a (distinct) name and score ($1 \le n \le 1000$, $0 \le \text{score} \le 100$).

Output

Print the sorted name score lines.

Example 1

Input
5
zoe 90
amy 90
bob 100
cody 80
mike 90
Output
bob 100
amy 90
mike 90
zoe 90
cody 80
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code