結果

問題 No.2015 Stair Counter
ユーザー ThetaTheta
提出日時 2022-10-27 10:44:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 29,832 KB
最終ジャッジ日時 2023-09-18 04:21:53
合計ジャッジ時間 3,822 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 80 ms
7,784 KB
testcase_02 AC 97 ms
7,776 KB
testcase_03 AC 102 ms
7,836 KB
testcase_04 AC 74 ms
7,968 KB
testcase_05 AC 64 ms
7,920 KB
testcase_06 AC 120 ms
7,796 KB
testcase_07 AC 122 ms
7,868 KB
testcase_08 AC 121 ms
7,820 KB
testcase_09 AC 41 ms
8,688 KB
testcase_10 AC 43 ms
8,564 KB
testcase_11 AC 45 ms
8,604 KB
testcase_12 AC 43 ms
10,800 KB
testcase_13 AC 42 ms
11,540 KB
testcase_14 AC 42 ms
10,800 KB
testcase_15 AC 64 ms
22,456 KB
testcase_16 AC 83 ms
28,516 KB
testcase_17 AC 46 ms
10,760 KB
testcase_18 AC 75 ms
25,116 KB
testcase_19 AC 95 ms
29,832 KB
testcase_20 AC 52 ms
12,048 KB
testcase_21 AC 72 ms
7,840 KB
testcase_22 AC 94 ms
7,832 KB
testcase_23 AC 115 ms
7,824 KB
testcase_24 AC 79 ms
7,788 KB
testcase_25 AC 77 ms
7,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():

    for _ in range(int(input())):
        N, M = map(int, input().split())
        A = list(map(int, input().split()))

        before = M
        before2 = 0
        for a in A:
            if a - before2 < 0 or a - before2 > before:
                print("No")
                break

            before, before2 = a, before - (a - before2)
        else:
            print("Yes")


if __name__ == "__main__":
    main()
0