結果

問題 No.2015 Stair Counter
ユーザー xsdxsd
提出日時 2022-07-27 01:41:47
言語 OCaml
(5.1.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 1,206 ms
コンパイル使用メモリ 19,652 KB
実行使用メモリ 7,152 KB
最終ジャッジ日時 2023-09-23 15:14:42
合計ジャッジ時間 5,307 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 24 ms
5,832 KB
testcase_02 AC 26 ms
5,848 KB
testcase_03 AC 25 ms
5,836 KB
testcase_04 AC 23 ms
5,780 KB
testcase_05 AC 22 ms
5,840 KB
testcase_06 AC 28 ms
5,792 KB
testcase_07 AC 26 ms
5,664 KB
testcase_08 AC 28 ms
5,820 KB
testcase_09 AC 19 ms
6,296 KB
testcase_10 AC 20 ms
6,192 KB
testcase_11 AC 23 ms
6,288 KB
testcase_12 AC 19 ms
6,280 KB
testcase_13 AC 19 ms
6,324 KB
testcase_14 AC 22 ms
6,248 KB
testcase_15 AC 26 ms
6,544 KB
testcase_16 AC 39 ms
7,004 KB
testcase_17 AC 24 ms
6,820 KB
testcase_18 AC 33 ms
6,700 KB
testcase_19 AC 43 ms
7,152 KB
testcase_20 AC 27 ms
7,136 KB
testcase_21 AC 24 ms
5,864 KB
testcase_22 AC 25 ms
5,792 KB
testcase_23 AC 27 ms
5,904 KB
testcase_24 AC 25 ms
5,820 KB
testcase_25 AC 25 ms
5,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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