結果

問題 No.70 睡眠の重要性!
ユーザー HIROPON87069639HIROPON87069639
提出日時 2016-02-21 16:54:07
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 7,116 KB
実行使用メモリ 6,448 KB
最終ジャッジ日時 2023-10-23 18:47:18
合計ジャッジ時間 607 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# -*- coding: utf-8 -*-

def calc(H, M, h, m):
    S = 60 * H + M
    B = 24 * 60
    if H <= h:
        W = 60 * h + m
    else:
        W = 60 * h + m + B
    if W < S:
        W += 24 * 60
    return W - S


N = input()
tot = 0
for i in range(0, N):
    S, W = raw_input().split()
    H, M = map(int, S.split(":"))
    h, m = map(int, W.split(":"))
    tot += calc(H, M, h, m)
print tot
0