Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Question by Ibrahim Mesecan.
Top m hardworking employees
Question:
In a file you have the extra work hours of n
Employees. Show top m hardworking employees.
Input specification
You will be given two integers in the beginning:
the number of employees (n) and the number employees
to list (m). Then, in the following n lines:
- Name surname of the employee: 2 strings (only 26
English letters) separated by a space
- The number of days worked (d): an integer not
greater than 31.
- On the same line you will be given d time information
where every time information contains hour
and minute information separated by a colon
where 0 ≤ n ≤ 10,000
Output specification:
Show name and surname of top m employees (who have
worked the most) in descending order. If any two employees
have the same working time show in ascending order according
to name and surname.
Sample Input
5 2
Kathryn Garrett 3 8:00 5:15 4:20
Edwin Wilkins 2 3:45 2:45
Chad Parks 2 2:30 1:30
Ellis Sanchez 0
Jenny Colon 4 7:35 7:30 6:00 6:00
|
Sample Output
Jenny Colon
Kathryn Garrett
|
Explanation: Here are the total
work time of five people
Name surname |
Total work hours |
Kathryn Garrett |
17:35 |
Edwin Wilkins |
6:30 |
Chad Parks |
4:00 |
Ellis Sanchez |
0:00 |
Jenny Colon |
27:05 |
So, Jenny Colon and Kathryn Garrett are the two
most hardworking employees.
Для отправки решений необходимо выполнить вход.
|