G. 2025夏-A-2 Self-reflection of My Phone

    传统题 400ms 256MiB

2025夏-A-2 Self-reflection of My Phone

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

"Please do some self-reflection(自我反省), my phone -- why do you keep dragging me into staying up late every night?" Your phone thinks it makes perfect sense. So it asks you to help it reflect on how many nights it has dragged its owner into staying up late over the past year, and which App was the most guilty.

输入格式

Each input file contains one test case. The first line gives a positive integer nn (105\le 10^5), which is the number of records of the owner. Then nn lines follow, each gives a record in the following format:

AppID ddd:hh:mm:ss

where AppID is a 3-digit index of an App; an ddd:hh:mm:ss is the activating time of this App, where ddd is the day in 3 digits in [0, 365), hh is the 2-digit hours in [0, 24), mm is the 2-digit minutes in [0, 60), and ss is the 2-digit seconds in [0, 60).

输出格式

It counts as one "stay up late" night if any App was activated between 11 pm and 3 am on the next day (that is, from (x):23:00:01 to (x+1):02:59:59). Print in two lines: output the total number of "stay up late" nights in the first line; and in the second line print the index of the App which was started the most times during the late nights -- if there is a tie, print in ascending order of their indices, with 1 space separating the numbers, and no extra space at the beginning or the end of the line. If the good owner never stay up late, print # in the second line instead to represent an empty output.

样例

8
123 011:00:25:16
233 013:23:00:00
666 013:23:00:01
745 100:00:00:01
222 012:12:25:18
233 011:23:13:23
666 012:01:10:59
745 013:02:59:59
5
666 745
2
123 364:03:00:00
456 000:23:00:00
0
#

限制

对于所有的测试用例,限制为200 ms, 64 MB

PAT2025夏季重现赛

未参加
状态
已结束
规则
IOI
题目
9
开始于
2025-7-13 14:00
结束于
2025-7-13 17:30
持续时间
3.5 小时
主持人
参赛人数
45