結果

問題 No.70 睡眠の重要性!
ユーザー nonokai10nonokai10
提出日時 2018-02-26 04:09:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 97 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-29 11:47:34
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
12,288 KB
testcase_01 AC 95 ms
12,160 KB
testcase_02 AC 93 ms
12,288 KB
testcase_03 AC 90 ms
12,288 KB
testcase_04 AC 92 ms
12,160 KB
testcase_05 AC 89 ms
12,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

sum = 0
gets.to_i.times do
  bedtime, wake_up_time = gets.split.map { |time| array = time.split(':').map(&:to_i) ; array[0]*60 + array[1] }
  sleeping_time = wake_up_time - bedtime
  sleeping_time += 24*60 if sleeping_time < 0
  sum += sleeping_time
end
puts sum
0