結果

問題 No.525 二度寝の季節
コンテスト
ユーザー maimai8
提出日時 2019-08-21 17:13:26
言語 OCaml
(5.4.1)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 386 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 240 ms
コンパイル使用メモリ 22,924 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-25 04:46:39
合計ジャッジ時間 3,089 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

let () =
    let h, t = Scanf.scanf "%2d:%2d\n" (fun a b -> a, b) in 
    let tt, b = if t < 55 then t+5, false else t+5-60, true in 
    let hh = if b && h < 23 then h+1 else if b then 0 else h in
    let ts = if tt < 10 then "0" ^ string_of_int tt else string_of_int tt in
    let hs = if hh < 10 then "0" ^ string_of_int hh else string_of_int hh in 
    Printf.printf "%s:%s\n" hs ts
0