結果

問題 No.70 睡眠の重要性!
ユーザー uu
提出日時 2018-03-06 20:34:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 789 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 10,708 KB
最終ジャッジ日時 2023-10-21 17:13:33
合計ジャッジ時間 1,126 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,704 KB
testcase_01 AC 32 ms
10,704 KB
testcase_02 AC 32 ms
10,708 KB
testcase_03 AC 33 ms
10,704 KB
testcase_04 AC 32 ms
10,704 KB
testcase_05 AC 32 ms
10,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def sleeping_sec(time_to_sleep,time_to_wake_up):
    import datetime

    neru_hour, neru_min = map(int, time_to_sleep.split(":"))
    okita_hour, okita_min = map(int, time_to_wake_up.split(":"))

    day1 = 1

    if neru_hour > okita_hour:
        day2 = 2
    elif neru_hour == okita_hour:
        if neru_min > okita_min:
            day2 = 2
        else:
            day2 = 1
    else :
        day2 = 1


    first_time = datetime.datetime(2018, 3, day1, neru_hour, neru_min)
    last_time = datetime.datetime(2018, 3, day2, okita_hour, okita_min)
    delta = last_time - first_time
    return(delta.total_seconds())


sleep_time_l = []

for _ in range(N):
    l = input().split()
    sleep_time_l.append(sleeping_sec(l[0], l[1]))

print(int(sum(sleep_time_l)/60))
0