結果

問題 No.70 睡眠の重要性!
ユーザー superzugansuperzugan
提出日時 2021-09-04 07:35:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 7,888 KB
最終ジャッジ日時 2023-08-22 13:44:00
合計ジャッジ時間 907 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

def timer(a,b,c,d):
    tmp1=a*60+b
    tmp2=c*60+d
    if tmp1<=tmp2:return (tmp2-tmp1)
    tmp1=24*60-tmp1
    return (tmp1+tmp2)
ans=0
n=int(input())
for _ in range(n):
    x,y=input().split()
    a,b=x.split(":")
    c,d=y.split(":")
    a,b,c,d=map(int,[a,b,c,d])
    ans+=timer(a,b,c,d)
print(ans)
0