結果

問題 No.2015 Stair Counter
ユーザー KudeKude
提出日時 2022-07-22 21:26:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 108,972 KB
最終ジャッジ日時 2023-09-17 08:48:03
合計ジャッジ時間 4,979 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,200 KB
testcase_01 AC 146 ms
77,868 KB
testcase_02 AC 152 ms
77,980 KB
testcase_03 AC 171 ms
78,308 KB
testcase_04 AC 138 ms
78,008 KB
testcase_05 AC 134 ms
77,788 KB
testcase_06 AC 156 ms
77,676 KB
testcase_07 AC 161 ms
78,100 KB
testcase_08 AC 161 ms
78,040 KB
testcase_09 AC 89 ms
76,752 KB
testcase_10 AC 91 ms
76,916 KB
testcase_11 AC 94 ms
76,872 KB
testcase_12 AC 87 ms
77,440 KB
testcase_13 AC 89 ms
78,704 KB
testcase_14 AC 92 ms
79,008 KB
testcase_15 AC 101 ms
95,472 KB
testcase_16 AC 114 ms
105,536 KB
testcase_17 AC 105 ms
99,364 KB
testcase_18 AC 107 ms
99,160 KB
testcase_19 AC 116 ms
108,972 KB
testcase_20 AC 110 ms
106,296 KB
testcase_21 AC 138 ms
77,784 KB
testcase_22 AC 145 ms
77,788 KB
testcase_23 AC 169 ms
79,336 KB
testcase_24 AC 140 ms
77,932 KB
testcase_25 AC 138 ms
77,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m = map(int, input().split())
    a = [0, m] + list(map(int, input().split()))
    for i in range(2, n + 2):
        x = a[i]
        x -= a[i - 2]
        if x < 0:
            print('No')
            break
        x = min(x, a[i-1])
        a[i-1] -= x
    else:
        print('Yes')
0