HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN112 Questions 2016 > problem:


15-PE2-2. 50984 - Top m hardworking employees

CEN112 Questions 2016

Start: Mar.30.2016 at 03:10:22 PM
Finish: Apr.01.2016 at 05:00:00 AM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 15-PE-1. 50865 - Apartment Building...
• 15-PE-2. 50866 - Buy the cheapest
• 15-PE-4. 50868 - Sort Frequencies
• 15-PE-5. 50869 - Birthday Celebration
• 15-PE-7. 50871 - Harmonic Mean
• 15-PE-8. 50872 - Top M Grades
• 15-PE2-1. 50980 - The smallest rect...
• 15-PE2-2. 50981 - Top popular m-st...
• 15-PE2-2. 50984 - Top m hardw...
• 15-PE2-2. 51086 - Top popular student
• 15-PE2-3. 50982 - A thief in labyrinth
• 15-PE2-4. 50983 - Course Selection
• 15-PE2-6. 50985 - Books Waiting
• 15-PE2-8. 50987 - Very Looong Queue
• 15-RE-2. 50999 - Overlapping Trips
• 3. 51002 - The most successful classes
• 4. 51003 - Double Prime

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