結果

問題 No.70 睡眠の重要性!
ユーザー kkron4221kkron4221
提出日時 2020-05-09 06:56:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 759 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 7,776 KB
最終ジャッジ日時 2023-09-18 08:03:05
合計ジャッジ時間 704 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())

ans = 0

for i in range(N):
    
    hour = 0
    minitue = 0
    correct_hour = 0
    correct_min = 0

    go_to_bed, wake_up = input().split()
    
    go_to_bed_hour, go_to_bed_min = [int(x) for x in go_to_bed.split(":")]
    wake_up_hour, wake_up_min = [int(x) for x in wake_up.split(":")]
    
    if go_to_bed_hour == 0:
        go_to_bed_hour = 24
    if wake_up_hour == 0:
        wake_up_hour = 24
    
    go_to_bed_min_time = go_to_bed_hour * 60 + go_to_bed_min
    wake_up_min_time = wake_up_hour * 60 + wake_up_min
    
    
    if wake_up_min_time > go_to_bed_min_time:
        ans = ans + wake_up_min_time - go_to_bed_min_time
    else:
        ans = ans + wake_up_min_time - go_to_bed_min_time + 1440
        
print(ans)
    
0