-->
当前位置:首页 > 题库

PROGRAMMING:Have you Kwai done today?

Luz5年前 (2021-05-10)题库438
Kwai is a relatively short video app software, which updates some interesting videos every day, so its appearance has become a way to kill time. But some of our students will not stop watching interesting videos when they come in and cause them to indulge in it. When you enter and exit Kwai app, its background has a record data, that is, the time to enter Kwai and the time to exit. Your class teacher wants to know how quickly your class has brushed up every day, so Kwai Kwai asked the backstage data of your class to get the quick platform, but the data are scattered. Your head teacher asks you to help him to sort every student's video time from small to large.
###Input format:
In the first line, give two integers n and m (1 ≤ n ≤ 1000, 0 ≤ m ≤ 10 ^ 4), n represents the number of students in your class, M represents the number of data, next, give a group of data in each line of M, the format is: student number entry time exit time, student number of your class is numbered from 0 ~ n-1 and is three digits. The title guarantees that all times given are within the same day.
###Output format:
Each student will be selected from Kwai Tong in a day, and the output time is equal to the size of the student number. The output format is: student number time, and last output the longest time.
Note: the output and output student number are three digits (less than three digits complement leading 0), and the output time format is: 00:00:00
###Input sample 1:
```in
3 5
000 19:48:30 19:59:24
002 18:45:40 19:01:20
000 21:32:28 21:53:30
001 12:30:16 12:43:19
001 13:05:36 13:37:33
```
###Output sample 1:
```out
001 00:45:00
000 00:31:56
002 00:15:40
```
###Input sample 2:
```in
3 5
000 12:03:31 12:13:12
002 12:00:28 12:54:41
001 16:04:44 16:34:47
001 07:30:29 07:54:39
000 23:17:18 23:29:33
```
###Output sample 2:
```out
001 00:54:13
002 00:54:13
000 00:21:56
```







answer:If there is no answer, please comment