結果

問題 No.70 睡眠の重要性!
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-08-26 12:34:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 16:55:48
合計ジャッジ時間 567 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = input()

sum = 0
for i in range(0, n):
	d1, d2 = raw_input().split()
	h1, m1 = map(int, d1.split(':'))
	h2, m2 = map(int, d2.split(':'))
	if h1 > h2 or (h1 == h2 and m1 > m2):
		time1 = h1 * 60 + m1
		time2 = (h2 + 24) * 60 + m2
		sum += time2 - time1
	else:
		time1 = h1 * 60 + m1
		time2 = h2 * 60 + m2
		sum += time2 - time1

print sum
0