HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Sorting and sequences > problem:


50984 - Top m hardworking employees

Guest
• Review clarifications (1)

Section problems

• 50927 - Health Expenses
• 50745 - Bitonic Sequence
• 50992 - Top K Obese Classes
• 50991 - Intersecting Circles
• 50447 - Swimming Contest - 2
• 50513 - Climbing Up the Stairs
• 50744 - The Smallest Perimeter
• 50743 - Total Scholarships Discount
• 50984 - Top m hardworking emp...
• 50847 - The first m trains to leave
• 51002 - The most successful classes
• Word Puzzle
• 50740 - Service Time - 1
• 50750 - Service Time - 2
• 50347 - Selling Oranges
• 50758 - National Elections - Revisited
• 50754 - Team Standings

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.

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.



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

www.contester.ru