結果

問題 No.70 睡眠の重要性!
ユーザー kamomekamome
提出日時 2020-05-22 10:58:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-04-14 23:35:37
合計ジャッジ時間 965 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#coding:utf-8
import datetime
N=int(input())
asleep=0
for i in range(N):
    t1_s,t2_s=input().split()
    if int(t1_s.split(":")[0]) > int(t2_s.split(":")[0]): # 日付またぐ
        t1_s="2020-05-21-"+t1_s
        t2_s="2020-05-22-"+t2_s
    else: #日付またがない
        t1_s="2020-05-22-"+t1_s
        t2_s="2020-05-22-"+t2_s
    t1=datetime.datetime.strptime(t1_s, '%Y-%m-%d-%H:%M')
    t2=datetime.datetime.strptime(t2_s, '%Y-%m-%d-%H:%M')
    asleep=asleep + ((t2-t1).seconds//60)
print(asleep)
0