結果

問題 No.70 睡眠の重要性!
ユーザー ymgckyoymgckyo
提出日時 2017-11-04 20:54:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-03 04:05:51
合計ジャッジ時間 891 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())
input_list = []

for i in range(n):
    input_list.append(list(input().split()))

amount = 0
for e in input_list:
    down_h, down_m = map(int, str(e[0]).split(':'))
    up_h, up_m = map(int, str(e[1]).split(':'))

    sleep_m = up_m - down_m
    sleep_h = up_h - down_h

    if sleep_h < 0:
        sleep_h += 24

    if sleep_m < 0:
        sleep_h -= 1
        sleep_m += 60

    if sleep_m >= 60:
        sleep_h += 1
        sleep_m -= 60

    amount += (sleep_h * 60) + sleep_m

print(amount)
0