結果

問題 No.70 睡眠の重要性!
ユーザー R NR N
提出日時 2020-08-22 13:54:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 665 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-23 08:18:40
合計ジャッジ時間 696 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# coding:utf-8
import datetime
n = int(input())
total = datetime.timedelta(hours=0,minutes=0)
for i in range(n):
    s, g = map(str, input().split())
    sl = s.split(':')
    gl = g.split(':')
    if int(sl[0]) >= 12 and int(sl[0]) < 24 :
        st = datetime.timedelta(days=-1,hours=int(sl[0]),minutes=int(sl[1]))
        gt = datetime.timedelta(days=0,hours=int(gl[0]),minutes=int(gl[1]))
        total += gt - st
    else:
        st = datetime.timedelta(days=0,hours=int(sl[0]),minutes=int(sl[1]))
        gt = datetime.timedelta(days=0,hours=int(gl[0]),minutes=int(gl[1]))
        total += gt - st

ans = total.days * 24 * 60 + total.seconds // 60
print(ans)
0