結果

問題 No.70 睡眠の重要性!
ユーザー ksomemoksomemo
提出日時 2017-10-05 23:07:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-28 07:55:00
合計ジャッジ時間 866 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def main():
    N = int(input())

    ans = 0
    for _ in range(N):
        st, end = input().split()
        st_h, st_m = map(int, st.split(":"))
        end_h, end_m = map(int, end.split(":"))

        h = end_h - st_h
        m = end_m - st_m
        if h < 0:
            h += 24
        if m < 0:
            h -= 1
            m += 60

        ans += h * 60 + m

    print(ans)

if __name__ == '__main__':
    main()
0