結果

問題 No.70 睡眠の重要性!
ユーザー pypypymipypypymi
提出日時 2022-02-17 21:09:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 694 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 71,828 KB
最終ジャッジ日時 2023-09-11 17:53:16
合計ジャッジ時間 1,633 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,544 KB
testcase_01 AC 93 ms
71,500 KB
testcase_02 AC 92 ms
71,804 KB
testcase_03 AC 91 ms
71,620 KB
testcase_04 AC 95 ms
71,828 KB
testcase_05 AC 95 ms
71,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import datetime as dt
n = int(input())
v = 0
for i in range(n):
    s1,s2 = input().split()
    s1_array = s1.split(":")
    s1_h = int(s1_array[0])
    s1_m = int(s1_array[1])
    s1_delta = dt.timedelta(hours=s1_h,minutes=s1_m)
    
    s2_array = s2.split(":")
    s2_h = int(s2_array[0])
    s2_m = int(s2_array[1])
    s2_delta = dt.timedelta(hours=s2_h,minutes=s2_m)
    
    #print(dt.timedelta(hours=24)-s1_delta)
    if s1_h<24 and s2_h<=s1_h:
        #print(((dt.timedelta(hours=24)-s1_delta).seconds+s2_delta.seconds)//60)
        v+=((dt.timedelta(hours=24)-s1_delta).seconds+s2_delta.seconds)//60
    else:
        v+=(s2_delta.seconds-s1_delta.seconds)//60
print(v)
    
    
    
0