結果

問題 No.2015 Stair Counter
ユーザー kokatsukokatsu
提出日時 2022-07-22 21:31:26
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 373 bytes
コンパイル時間 2,117 ms
コンパイル使用メモリ 205,444 KB
実行使用メモリ 11,628 KB
最終ジャッジ日時 2023-09-04 17:53:48
合計ジャッジ時間 5,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 13 ms
4,592 KB
testcase_14 WA -
testcase_15 AC 19 ms
8,372 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 26 ms
9,116 KB
testcase_19 AC 31 ms
11,244 KB
testcase_20 AC 18 ms
11,084 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int T;
    readf("%d\n", T);

    foreach (_; 0 .. T) {
        int N, M;
        readf("%d %d\n", N, M);

        auto A = [M] ~ readln.chomp.split.to!(int[]);

        bool isOK = true;
        foreach (i; 2 .. N) {
            int d = A[i-2] - A[i-1];
            isOK &= A[i] >= d;
        }

        writeln(isOK ? "Yes" : "No");
    }
}
0