結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
ymgckyo
|
| 提出日時 | 2017-11-04 21:09:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 5,000 ms |
| コード長 | 575 bytes |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-24 01:14:01 |
| 合計ジャッジ時間 | 881 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
n = int(input())
input_list = []
for i in range(n):
input_list.append(list(input().split()))
amount = 0
for e in input_list:
down_h, down_m = map(int, str(e[0]).split(':'))
up_h, up_m = map(int, str(e[1]).split(':'))
sleep_m = up_m - down_m
sleep_h = up_h - down_h
if sleep_h == 0 and sleep_m < 0:
sleep_h += 24
if sleep_h < 0:
sleep_h += 24
if sleep_m < 0:
sleep_h -= 1
sleep_m += 60
if sleep_m >= 60:
sleep_h += 1
sleep_m -= 60
amount += (sleep_h * 60) + sleep_m
print(amount)
ymgckyo