結果

問題 No.70 睡眠の重要性!
ユーザー rkyrky
提出日時 2017-11-07 09:26:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 31 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-03 06:45:31
合計ジャッジ時間 1,003 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
12,160 KB
testcase_01 AC 80 ms
12,160 KB
testcase_02 AC 79 ms
12,160 KB
testcase_03 AC 76 ms
12,160 KB
testcase_04 AC 78 ms
12,160 KB
testcase_05 AC 77 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

test_case = gets.chomp.to_i
result = 0

for i in 0...test_case do
	s, e = gets.split(' ')
	sh, sm = s.split(':').map(&:to_i)
	eh, em = e.split(':').map(&:to_i)
	start_time = sh * 60 + sm
	end_time = eh *  60 + em
	end_time += 24 * 60 if start_time > end_time
	result += (end_time - start_time)
end
puts result
0