Among the many YouTubers, virtual YouTubers exist
InterviewTime limit1sMemory limit1024 MB
Given broadcast logs, find the YouTubers who have 5 broadcasts in some Sunday-to-Saturday week with 60 hours or more of total live time.
- Level
Easy3 of 10
- Topics
- Hash map, Simulation, Sorting
- Solved
- No attempts yet
Problem
There are many YouTubers in the world, and some of them are virtual YouTubers. A virtual YouTuber who streams live times a week, with a total of at least hours of live streaming per week, is called a real virtual YouTuber. Hyeongsik likes virtual YouTubers and wants to find the real virtual YouTubers. Given lines, each with a YouTuber's name, a broadcast day, a start time, and an end time, print the names of the real virtual YouTubers in lexicographic order.
Day is a Sunday. A week runs from Sunday to Saturday.
Input
The first line contains the number of broadcasts and the last day that Hyeongsik watched, separated by a space. is a multiple of
The next lines each contain name day hh:mm hh:mm, separated by spaces: the YouTuber's name, the broadcast day, the start time, and the end time. Times use the 24-hour clock.
A name has at most characters, contains no spaces, and consists only of lowercase English letters. Names are distinct, so each name identifies one YouTuber. There are at most YouTubers.
A broadcast lasts at most hours and minutes. No broadcast starts on one day and continues past midnight into the next day, so the start and end dates are always the same. A YouTuber broadcasts at most once per day.
Output
Print the names of the real virtual YouTubers in lexicographic order, one per line. If there are none, print -1.
Hints
A broadcast that starts at 00:01 and ends at 01:20 lasts 1 hour and 19 minutes.
The start time is always earlier than the end time.
The input order may not be sorted by broadcast day.