結果

問題 No.70 睡眠の重要性!
ユーザー mkawa2mkawa2
提出日時 2019-12-17 09:00:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 690 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-09-15 19:21:20
合計ジャッジ時間 715 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n = int(input())
    ans = 0
    for _ in range(n):
        hm0, hm1 = input().split()
        h0, m0 = map(int, hm0.split(":"))
        h1, m1 = map(int, hm1.split(":"))
        if m1 < m0:
            m1 += 60
            h1 -= 1
        if h1 < h0: h1 += 24
        ans += 60 * (h1 - h0) + (m1 - m0)
    print(ans)

main()
0