結果
| 問題 | No.70 睡眠の重要性! | 
| コンテスト | |
| ユーザー |  kokoa1046 | 
| 提出日時 | 2018-01-31 11:28:44 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 34 ms / 5,000 ms | 
| コード長 | 603 bytes | 
| コンパイル時間 | 243 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-29 23:42:53 | 
| 合計ジャッジ時間 | 1,057 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
n = int(input())
total = 0
w_all = 0
s_all = 0
for i in range(n):
  s, w = input().split()
  s_h, s_m= map(int, s.split(':'))
  w_h, w_m= map(int, w.split(':'))
  if len(str(s_h)) == 2 and len(str(w_h)) <= 1:
    w_all = int(w_h) * 60 + 1440 + int(w_m)
    s_all = int(s_h) * 60 + int(s_m)
  elif s_h == 0 and w_h == 0 and s_m <= w_m:
    w_all = w_m - s_m
  elif s_h == 0 and w_h == 0 and s_m >= w_m:
    w_all = 1440 - s_m
  elif len(str(s_h)) <= 1 and len(str(w_h)) <= 1:
    w_all = int(w_h) * 60 + 1440 + int(w_m)
    s_all = int(s_h) * 60 + 1440 + int(s_m)
  total += w_all - s_all
print(total)
            
            
            
        