結果

問題 No.70 睡眠の重要性!
ユーザー rkyrky
提出日時 2017-11-07 09:26:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 11,196 KB
実行使用メモリ 15,288 KB
最終ジャッジ日時 2023-08-15 20:01:35
合計ジャッジ時間 1,822 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,216 KB
testcase_01 AC 71 ms
15,288 KB
testcase_02 AC 71 ms
15,068 KB
testcase_03 AC 70 ms
15,028 KB
testcase_04 AC 68 ms
15,124 KB
testcase_05 AC 69 ms
15,140 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