結果

問題 No.70 睡眠の重要性!
ユーザー mnrmnr
提出日時 2020-02-27 23:09:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-21 17:06:43
合計ジャッジ時間 1,136 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())
T = []
for i in range(N):
    bd, up = map(str, input().split())
    bd = bd.split(':')
    up = up.split(':')
    time = [bd, up]
    T.append(time)

slptm = 0
for i in range(N):
    t0_i = int(T[i][0][0]) 
    t1_i = int(T[i][0][1])
    t2_i = int(T[i][1][0])
    t3_i = int(T[i][1][1])
    
    bd_m = 60*t0_i + t1_i
    up_m = 60*t2_i + t3_i

    if bd_m > up_m:
        slp = up_m + (24*60 - bd_m)
        slptm += slp
    else:
        slp = up_m - bd_m
        slptm += slp

print(slptm)
0