Submission #36617094


Source Code Expand

from datetime import datetime, timedelta

h, m = map(int, input().split())
dt = datetime(2000, 1, 1, hour=h, minute=m)

def valid_h(h):
    h10, h1 = divmod(h, 10)
    return h10 <2 or h10 == 2 and h1 <=3

def valid_m(m):
    m10, m1 = divmod(m, 10)
    return m10 <=5

while True:
    h10, h1 = divmod(dt.hour, 10)
    m10, m1 = divmod(dt.minute, 10)
    
    if valid_h(h10 * 10 + m10) and valid_m(h1 * 10 + m1):
        break
    
    dt += timedelta(minutes=1)

print(dt.hour, dt.minute)

Submission Info

Submission Time
Task B - Misjudge the Time
User arakaki_tokyo
Language PyPy3 (7.3.0)
Score 200
Code Size 513 Byte
Status AC
Exec Time 69 ms
Memory 65960 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 15
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 69 ms 63744 KiB
00_sample_01.txt AC 49 ms 63668 KiB
00_sample_02.txt AC 50 ms 64000 KiB
01_random_00.txt AC 48 ms 63708 KiB
01_random_01.txt AC 54 ms 63924 KiB
01_random_02.txt AC 52 ms 64016 KiB
01_random_03.txt AC 50 ms 63740 KiB
01_random_04.txt AC 50 ms 63672 KiB
02_handmade_00.txt AC 50 ms 63680 KiB
02_handmade_01.txt AC 53 ms 63896 KiB
02_handmade_02.txt AC 61 ms 65960 KiB
02_handmade_03.txt AC 50 ms 64156 KiB
02_handmade_04.txt AC 50 ms 63848 KiB
02_handmade_05.txt AC 51 ms 63972 KiB
02_handmade_06.txt AC 50 ms 63708 KiB