10279_LogBooks

2022-5-16 18:16| 发布者: Hocassian| 查看: 58| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504724857500-Problem List-采集的数据-后羿采集器.html

Pro.ID

10279

Title

Log Books

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10279

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 6000/3000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Learner drivers need to complete 50 hours of supervised driving with at least 10 hours, or more, of night driving included in the total amount. Each learner must keep a log book of their supervised driving experience with each entry containing the starting and finishing time for each driving experience.

    Poirot-the-inspector has been given the duty of checking the log books and verifying that the driving times add up to the required values and that no single driving experience exceeds 2 hours. If more than, or equal to, half the length of one driving experience occurs during the night (before sunrise or after sunset), then the whole time counts towards night driving. For example, driving from 04:50 to 06:10 on a day when sunrise is at 05:30 counts as night driving.

    However, Poirot has never been good with numbers and he is requesting assistance with this duty. Your task is to write a program that reads a learner's log book and checks that the required driving times have been completed without violating the 2 hour length rule.

    输入

    The input consists of a number of test cases. The description for each test case starts with an integer N, on a line by itself, that represents the number of entries in one log book. 25 ≤ N 300. Each of the following N lines contains a record of one driving experience with four times representing sunrise, sunset, and the starting and finishing time in that order. The starting time is strictly smaller than the finishing time. A single space separates the times and each time has a value between 00:00 (midnight) and 23:59 (one minute to midnight), inclusive. A line with a zero by itself terminates the input and is not to be processed.

    Here is the sample input file for you.

    输出

    Description

    Learner drivers need to complete 50 hours of supervised driving with at least 10 hours, or more, of night driving included in the total amount. Each learner must keep a log book of their supervised driving experience with each entry containing the starting and finishing time for each driving experience.

    Poirot-the-inspector has been given the duty of checking the log books and verifying that the driving times add up to the required values and that no single driving experience exceeds 2 hours. If more than, or equal to, half the length of one driving experience occurs during the night (before sunrise or after sunset), then the whole time counts towards night driving. For example, driving from 04:50 to 06:10 on a day when sunrise is at 05:30 counts as night driving.

    However, Poirot has never been good with numbers and he is requesting assistance with this duty. Your task is to write a program that reads a learner's log book and checks that the required driving times have been completed without violating the 2 hour length rule.

    Input

    The input consists of a number of test cases. The description for each test case starts with an integer N, on a line by itself, that represents the number of entries in one log book. 25 ≤ N 300. Each of the following N lines contains a record of one driving experience with four times representing sunrise, sunset, and the starting and finishing time in that order. The starting time is strictly smaller than the finishing time. A single space separates the times and each time has a value between 00:00 (midnight) and 23:59 (one minute to midnight), inclusive. A line with a zero by itself terminates the input and is not to be processed.

    Here is the sample input file for you.

    Output

    The output for each log book consists of the string PASS if the required driving times have been completed without violating the 2 hour length rule. Otherwise, print the string NON.

    Sample Input

    120
    05:34 17:41 04:01 04:18
    06:49 19:02 06:27 07:29
    06:55 18:31 12:18 22:44
    07:02 17:55 09:06 10:37
    06:49 19:30 04:00 04:22
    07:12 18:25 09:14 10:35
    few lines deleted
    06:41 19:33 07:21 08:33
    05:25 17:30 20:29 21:21
    05:21 19:47 19:29 19:32
    07:45 17:46 08:05 09:37
    07:02 19:26 05:11 06:26
    07:01 18:16 11:30 12:51
    176
    07:36 18:33 05:00 06:24
    06:22 19:51 08:06 09:51
    05:17 19:27 15:20 15:46
    05:33 19:31 13:25 13:56
    07:35 17:51 16:05 17:56
    05:38 17:30 19:25 20:25
    05:34 18:23 13:14 14:41
    06:23 17:58 13:19 14:18
    06:05 19:08 12:29 13:55
    07:28 18:36 20:16 20:22
    05:38 18:35 12:10 12:21
    few lines deleted
    07:19 17:36 05:15 05:16
    07:26 17:00 10:14 10:27
    05:14 19:50 08:28 08:52
    06:06 17:34 13:01 14:32
    06:59 18:14 13:34 13:38
    06:41 18:41 05:33 06:59
    0

    Sample Output

    NON
    PASS

    Source

    样例输入

    120
    05:34 17:41 04:01 04:18
    06:49 19:02 06:27 07:29
    06:55 18:31 12:18 22:44
    07:02 17:55 09:06 10:37
    06:49 19:30 04:00 04:22
    07:12 18:25 09:14 10:35
    few lines deleted
    06:41 19:33 07:21 08:33
    05:25 17:30 20:29 21:21
    05:21 19:47 19:29 19:32
    07:45 17:46 08:05 09:37
    07:02 19:26 05:11 06:26
    07:01 18:16 11:30 12:51
    176
    07:36 18:33 05:00 06:24
    06:22 19:51 08:06 09:51
    05:17 19:27 15:20 15:46
    05:33 19:31 13:25 13:56
    07:35 17:51 16:05 17:56
    05:38 17:30 19:25 20:25
    05:34 18:23 13:14 14:41
    06:23 17:58 13:19 14:18
    06:05 19:08 12:29 13:55
    07:28 18:36 20:16 20:22
    05:38 18:35 12:10 12:21
    few lines deleted
    07:19 17:36 05:15 05:16
    07:26 17:00 10:14 10:27
    05:14 19:50 08:28 08:52
    06:06 17:34 13:01 14:32
    06:59 18:14 13:34 13:38
    06:41 18:41 05:33 06:59
    0

    样例输出

    NON
    PASS

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部