結果

問題 No.2015 Stair Counter
コンテスト
ユーザー xsd
提出日時 2022-07-27 01:41:47
言語 OCaml
(5.5.1)
コンパイル:
ocamlfind ocamlopt -linkpkg -package zarith,str _filename_ -o a.out
実行:
./a.out
結果
AC  
実行時間 27 ms / 2,000 ms
+ 96µs
コード長 395 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,019 ms
コンパイル使用メモリ 22,436 KB
実行使用メモリ 9,808 KB
最終ジャッジ日時 2026-10-16 01:34:49
合計ジャッジ時間 4,193 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます
コンパイルメッセージ
ocamlfind: [WARNING] Cannot read directory ./stublibs which is mentioned in ld.conf

ソースコード

diff #
raw source code

Scanf.scanf "%d" (fun t ->
    for i = 1 to t do
        Scanf.scanf " %d %d" (fun n m ->
            let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
            let rec loop i =
                if i = n - 1 then "Yes" else
                    if a.(i) + a.(i + 1) >= m then loop (i + 1) else "No"
            in
            Printf.printf "%s\n" @@ loop 0
        )
    done
)
0