| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 2048 MB | 28 | 26 | 22 | 91.667% |
Your professor is wondering when to schedule their office hours for the upcoming semester. Since every student has a different schedule, the professor needs to find the best time to host office hours.
Your task is to output the time and day of the week that your professor should host office hours given the availability of the students. Your professor can host one hour of office hours per week, so you must find the time at which the largest number of students are available to attend office hours.
For simplicity, 24ドル$-hour time will be used (there is no AM/PM). Each day starts at midnight which is denoted as 00:00. The last hour of the day starts at 23:00 (11:00 PM).
The first line of input will be an integer 1ドル \leq N \leq 10,000円,ドル the number of availability reports that follow. The next $N$ lines will contain each person's name, a day they have availability, an integer 1ドル \leq X \leq 24$ indicating how many hours they are available on that day, and $X$ integers indicating the hours in 24ドル$-hour time when they are available that day, each separated by a space.
An integer $H$ denoting when a student has availability means that they are available from H:00 until (H+1):00. All integers $H$ representing times will be in the range $[0, 23]$.
Note that a student's name may appear on more than one line if they have availability on more than one day of the week. Names are guaranteed to have no spaces.
A string with the best day ($D$) and time ($T$) for office hours:
Your professor should host office hours D @ T
where $D$ is one of "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", or "Saturday" (without the quotes) and $T$ is a zero-padded time representing the start of the office hours in 24ドル$-hour time. (If the time is before 10:00, then there should be a leading 0ドル$ as in 01:00.)
Note that the solution is guaranteed to be unique. That is, there is a single day and time for which the maximum number of students are available to attend office hours.
6 Ethan Monday 2 10 14 Ethan Tuesday 1 5 Sumner Monday 2 10 17 Sumner Friday 1 2 Colin Tuesday 1 15 Colin Friday 1 3
Your professor should host office hours Monday @ 10:00
1 Mariana Monday 1 7
Your professor should host office hours Monday @ 07:00
School > CS@Mines > CS@Mines HSPC 2022 > Beginner H번