結果

問題 No.296 n度寝
ユーザー Hirotaka HanadaHirotaka Hanada
提出日時 2016-01-28 20:17:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 196 ms / 1,000 ms
コード長 289 bytes
コンパイル時間 35 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-09-21 08:20:56
合計ジャッジ時間 2,626 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
15,164 KB
testcase_01 AC 111 ms
15,336 KB
testcase_02 AC 89 ms
15,136 KB
testcase_03 AC 79 ms
15,368 KB
testcase_04 AC 78 ms
15,200 KB
testcase_05 AC 79 ms
15,224 KB
testcase_06 AC 78 ms
15,228 KB
testcase_07 AC 189 ms
15,280 KB
testcase_08 AC 167 ms
15,088 KB
testcase_09 AC 78 ms
15,144 KB
testcase_10 AC 79 ms
15,112 KB
testcase_11 AC 78 ms
15,224 KB
testcase_12 AC 78 ms
15,112 KB
testcase_13 AC 81 ms
15,032 KB
testcase_14 AC 80 ms
15,160 KB
testcase_15 AC 78 ms
15,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

def getTime(n, h, m, t)

th = t / 60
tm = t % 60

  for i in 1..n-1
  h = h + th
  m = m + tm
    if m > 59 then
      h = h + 1
      m = m % 60
    end
    if h > 23 then
      h = h % 24
    end
  end
puts h
puts m

end

N,H,M,T = gets.split(" ")
getTime(N.to_i, H.to_i, M.to_i, T.to_i)
0