DWITE '07 R4 #2 - And the winner is...

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, January 2008, Problem 2

This one is quite straightforward. Given a list of scores and names, sort the entries from highest score to lowest, to create the high score table. The only caveat is that this must be an in-place sort, meaning that given two entries with the same score, one that appeared earlier in the original unsorted list will always be placed higher than the other entry with the same score.

The input will contain five sets of data, five lines each. Each line will be in the score name format. Score is an integer, 0 \le s \le 700. Name is a standard string, possibly including spaces.

The output will contain 25 lines – five sorted sets. Only the name needs to be given per line.

Sample Input

517 Byakuei
549 O(256)
571 Clan 345
584 Beat Guru #1
609 while (true)
1 a
700 b
10 d
700 c
10 e

Sample Output

while (true)
Beat Guru #1
Clan 345

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported


  • 0
    NewAccount  commented on March 12, 2019, 10:48 p.m.

    I don't know how my most recent submission is wrong. I think I considered all the cases.

    • 3
      geese  commented on March 13, 2019, 2:20 a.m.

      The input will contain five sets of data, five lines each.