結果

問題 No.296 n度寝
ユーザー piconic_Xpiconic_X
提出日時 2015-11-07 18:57:10
言語 OCaml
(5.1.0)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 368 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 21,444 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 08:30:27
合計ジャッジ時間 917 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,812 KB
testcase_01 AC 3 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 4 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,948 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let minute_to_hour m =
    (m / 60) mod 24

let waketime n h m t =
  let rec wakeminutes n' m' =
    if n' = 1 then
      let hour = minute_to_hour m' in
      let minute = m' mod 60 in
      Printf.printf "%d\n%d\n" hour minute
    else
      wakeminutes (n'- 1) (m' + t)
  in
  wakeminutes n (h * 60 + m)

let () = Scanf.sscanf (read_line ()) "%d %d %d %d" waketime
0