結果

問題 No.70 睡眠の重要性!
ユーザー boya978boya978
提出日時 2019-09-08 05:23:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 483 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-09-09 22:21:31
合計ジャッジ時間 680 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 14 ms
7,828 KB
testcase_02 AC 14 ms
7,764 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 15 ms
7,936 KB
testcase_05 AC 14 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
hour=0
time=0

for i in range(n):
    data = input().split()
    bed = list(map(int,data[0].split(":")))
    wake = list(map(int,data[1].split(":")))
    
    if wake[0]>=bed[0]:
        hour = wake[0] - bed[0]
    else:
        hour = 24-bed[0] + wake[0]
    
    if wake[1]>=bed[1]:
        min = wake[1]-bed[1]
    else:
        min = 60-bed[1] + wake[1]
        hour -= 1
    
    if hour<0:
        hour += 24
        
    time += hour*60 + min
    
print(time)
0