結果

問題 No.70 睡眠の重要性!
ユーザー pluto77pluto77
提出日時 2016-02-29 21:31:40
言語 Python2
(2.7.18)
結果
AC  
実行時間 10 ms / 5,000 ms
コード長 407 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 7,052 KB
実行使用メモリ 6,412 KB
最終ジャッジ日時 2023-10-24 19:13:58
合計ジャッジ時間 682 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#coding: utf-8
##yuki_70

def hm(s):
 if len(s)==5:
  h=s[0]+s[1]
  m=s[3]+s[4]
 elif len(s)==4:
  if s[1]==':':
   h='0'+s[0]
   m=s[2]+s[3]
  elif s[2]==':':
   h=s[0]+s[1]
   m='0'+s[3]
 elif len(s)==3:
  h='0'+s[0]
  m='0'+s[2]
 return int(h)*60+int(m) #minutes

n=int(raw_input())
res=0
for i in xrange(n):
 t=raw_input().split()
 et=0
 et=hm(t[1])-hm(t[0])
 if et<0:
  et=et+60*24
 res+=et

print res
0