結果

問題 No.1026 OGAWA's New Keyboard
ユーザー xsd
提出日時 2020-06-21 11:53:24
言語 OCaml
(5.2.1)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 456 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 21,448 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-10-09 01:36:09
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%d" (fun n ->
    let rec loop i head tail =
        if i = n then head, tail else
            let head, tail = Scanf.scanf " %d %c" (fun t c ->
                if t = 0 then head, c :: tail
                         else c :: head, tail
            )
            in
            loop (i + 1) head tail
    in
    let h, t = loop 0 [] [] in

    let show l = List.iter (print_char) l in

    show h;
    show (List.rev t);
    print_newline ()
)
0