結果

問題 No.2015 Stair Counter
ユーザー ニックネームニックネーム
提出日時 2022-07-22 21:31:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 29,968 KB
最終ジャッジ日時 2023-09-17 08:58:33
合計ジャッジ時間 5,070 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,884 KB
testcase_01 AC 140 ms
7,836 KB
testcase_02 AC 150 ms
7,840 KB
testcase_03 AC 154 ms
7,812 KB
testcase_04 AC 123 ms
7,904 KB
testcase_05 AC 111 ms
7,808 KB
testcase_06 AC 175 ms
7,844 KB
testcase_07 AC 174 ms
7,812 KB
testcase_08 AC 178 ms
7,812 KB
testcase_09 AC 90 ms
8,556 KB
testcase_10 AC 95 ms
8,592 KB
testcase_11 AC 100 ms
8,524 KB
testcase_12 AC 89 ms
11,148 KB
testcase_13 AC 90 ms
11,664 KB
testcase_14 AC 91 ms
10,964 KB
testcase_15 AC 129 ms
22,344 KB
testcase_16 AC 181 ms
27,108 KB
testcase_17 AC 140 ms
11,756 KB
testcase_18 AC 152 ms
25,112 KB
testcase_19 AC 198 ms
29,968 KB
testcase_20 AC 172 ms
12,820 KB
testcase_21 AC 123 ms
7,812 KB
testcase_22 AC 146 ms
7,840 KB
testcase_23 AC 164 ms
7,840 KB
testcase_24 AC 126 ms
8,000 KB
testcase_25 AC 125 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    b = [m]+[0]*n
    ans = "Yes"
    for i in range(n-1):
        b[i+1], b[i+2] = a[i], b[0]-a[i]
        if b[i+2] < 0 or a[i+1] < b[i+2]: ans = "No"
    print(ans)
0