結果

問題 No.70 睡眠の重要性!
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-08-26 12:34:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 1,047 ms
コンパイル使用メモリ 6,520 KB
実行使用メモリ 6,104 KB
最終ジャッジ日時 2023-08-07 22:36:08
合計ジャッジ時間 688 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,024 KB
testcase_01 AC 12 ms
6,052 KB
testcase_02 AC 12 ms
6,104 KB
testcase_03 AC 11 ms
6,020 KB
testcase_04 AC 12 ms
6,104 KB
testcase_05 AC 11 ms
5,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