結果

問題 No.70 睡眠の重要性!
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-01-29 22:54:37
言語 Ruby
(3.3.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 257 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 15,276 KB
最終ジャッジ日時 2023-10-14 07:52:31
合計ジャッジ時間 1,953 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,272 KB
testcase_01 AC 81 ms
15,040 KB
testcase_02 AC 81 ms
15,276 KB
testcase_03 AC 83 ms
15,240 KB
testcase_04 AC 82 ms
15,040 KB
testcase_05 AC 81 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def to_min(hhmm)
  h, m = hhmm.split(':').map(&:to_i)
  h * 60 + m
end

n = gets.chomp.to_i
ans = 0
n.times do
  from, to = gets.chomp.split

  m_from = to_min(from)
  m_to   = to_min(to)
  m_to += 24*60 if m_to < m_from

  ans += m_to - m_from
end
puts ans
0