HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN_114 Midterm A > problem:


15. 50804 - Marathon

CEN_114 Midterm A

Start: May.14.2020 at 12:00:01 AM
Finish: May.31.2020 at 11:55:59 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 1. 50467 - Random Numbers
• 10. 51093 - rgb2gray
• 11. 50410 - Zero Padding
• 12. 50470 - Close Pairs - Revised
• 13. 50735 - Top M Products
• 14. 51094 - Passing the course
• 15. 50804 - Marathon
• 3. 50390 - Total Salary Paid
• 4. 50528 - Rock-Scissors-Paper
• 5. 51087 - Are they the same?
• 6. 51092 - Even and Odd
• 7. 50449 - The biggest result
• 8. 51146 - Popular Baby Names
• 9. 50499 - Table to Row

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Marathon

The organization committee of the marathon Istanbul invited you to write the program to show top m runners.

Question: Write a program that is going to read time information for n-athletes and show the ids of top m athletes.

Input specification
In the first line, you will be given two numbers (n and m). Then, in the following n lines, you will be given 3 integers (hour minute and seconds) where 0 ≤ m ≤ n ≤ 50,000

Output specification
Show m integers: ids of top m runners. If the times are the same, show the athlete with a smaller id.

Sample Input I   
5 3
23 45 58
2 7 3
11 1 20
1 36 3
11 47 4
Sample Input II   
6 4
13 29 27
10 34 33
7 26 10
10 41 45
5 57 56
2 31 28
Sample Output I   
4 2 3
Sample Output II   
6 5 3 2

Explanation (for the first input): The fourth athlete has completed the marathon the fastest in 1 hour 36 minutes and 3 seconds. Then the second athlete comes who has finished in 2 hours 7 minutes and 3 seconds. etc.

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

www.contester.ru