結果

問題 No.70 睡眠の重要性!
ユーザー kamomekamome
提出日時 2020-05-22 10:58:46
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2023-07-27 11:14:57
合計ジャッジ時間 1,255 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
9,692 KB
testcase_01 AC 33 ms
9,924 KB
testcase_02 AC 33 ms
9,884 KB
testcase_03 AC 36 ms
9,772 KB
testcase_04 AC 34 ms
9,780 KB
testcase_05 AC 34 ms
9,772 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