結果

問題 No.70 睡眠の重要性!
ユーザー oz4point5oz4point5
提出日時 2019-03-30 18:18:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 437 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-27 17:23:42
合計ジャッジ時間 736 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# -*- coding: utf-8 -*-
n = int(input())
H = [0] * n
M = [0] * n
h = [0] * n
m = [0] * n
for i in range(n):
    temp1,temp2 = list(input().split())
    H[i],M[i] = map(int,temp1.split(":"))
    h[i],m[i] = map(int,temp2.split(":"))

def timelen(h1,m1,h2,m2):
    m1 += h1 * 60
    m2 += h2 * 60
    m = m2 - m1
    if m < 0:
        m += 1440
    return m

ans = 0

for i in range(n):
    ans += timelen(H[i],M[i],h[i],m[i])

print(ans)
0