ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN112 Homeworks 2013-2015 > задача:


14-Spr1-30. 50492 - Contest Scoreboard

CEN112 Homeworks 2013-2015

Старт: 15.дек.2013 в 12:00:00
Финиш: 15.дек.2013 в 17:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 50388 - Number of Armstrong Num...
• 50393 - Palindromic Numbers
• 50339 - The Largest Rectangle
• 50345 - Orders
• 50758 - National Elections - Revisited
• 50754 - Team Standings
• 12-Spr1-40. 50327 - Parallel Lines
• 13-Fall2-20. 50395 - Page "Like" Av...
• 14-Spr1-30. 50492 - Contest Sc...
• 14-Spr1-40. 50538 - Sum of kth Dia...
• 14-Spr1-60. 50647 - Спираль
• 14-Spr2-20. 50442 - Polynomial Add...
• 14-Spr2-40. 50361 - Align Two Lists
• 14-Spr2-50. 50616 - Змейка
• 14-Spr2-60. 50444 - n digit kth nu...
• 15-SprHW-20. 50446 - Snake
• 15-SprHW-30. 50788 - Eight Puzzle

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Arnold Drita.

Contest scoreboard

A pretty nasty DDOS attack hit Epoka servers last night, and parts of the code got corrupted. Especially the one that deals with showing the scoreboard to the students in a contest. Professor Ibrahim has asked you to help him repair ACM servers by building the code for the scoreboard.

You will be given the username of each competitor, the amount of questions he has solved and the amount of time (in minutes) it took him to solve all the questions. You have to display the scoreboard with a number indicating the student position, his username, the number questions he solved and the time it took him using the following sorting method. First sort them by the number of questions solved (the student with more questions should obviously be placed before the others) and then, if they solved the same amount of questions, sort them by the time it took them to finish (the one who finished faster should be ranked first). Show this information for all the students.

Input:
You will be given an integer 1<=n<=1000 which indicates the number of competitors. Then you will be given n entries formatted as the following “username solved-questions time” where username is a string not more than 15 characters, solved questions is an integer 0<=s<=500 and time is an integer 0<=t<=5000.

Output:

 Show the sorted list of students in the following format: “nr. Username solved-questions time” where nr is the rank of the student 1<=nr<=n

Samples:

 

 

Input

Output

Test 1

5

Richard 2 150

Arben 5 350

Artan 9 500

Elton 9 450

Andi 8 200

 

1. Elton 9 450

2. Artan 9 500

3. Andi 8 200

4. Arben 5 350

5. Richard 2 150

Test 2

3

Ardit 1 15

Kristi 3 325

Saadi 0 0

1. Kristi 3 325

2. Ardit 1 15

3. Saadi 0 0

 

Для отправки решений необходимо выполнить вход.

www.contester.ru