結果

問題 No.2015 Stair Counter
ユーザー ShirotsumeShirotsume
提出日時 2022-01-13 17:42:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 102,016 KB
最終ジャッジ日時 2024-04-28 23:02:59
合計ジャッジ時間 5,696 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,840 KB
testcase_01 AC 145 ms
77,184 KB
testcase_02 AC 165 ms
77,696 KB
testcase_03 AC 154 ms
77,476 KB
testcase_04 AC 150 ms
77,312 KB
testcase_05 AC 129 ms
77,340 KB
testcase_06 AC 175 ms
77,440 KB
testcase_07 AC 159 ms
77,484 KB
testcase_08 AC 180 ms
77,696 KB
testcase_09 AC 62 ms
75,008 KB
testcase_10 AC 78 ms
75,392 KB
testcase_11 AC 68 ms
75,008 KB
testcase_12 AC 68 ms
75,648 KB
testcase_13 AC 59 ms
76,544 KB
testcase_14 AC 71 ms
76,416 KB
testcase_15 AC 68 ms
85,276 KB
testcase_16 AC 82 ms
98,688 KB
testcase_17 AC 67 ms
88,704 KB
testcase_18 AC 72 ms
91,136 KB
testcase_19 AC 84 ms
102,016 KB
testcase_20 AC 74 ms
95,872 KB
testcase_21 AC 138 ms
77,680 KB
testcase_22 AC 168 ms
77,440 KB
testcase_23 AC 159 ms
77,312 KB
testcase_24 AC 157 ms
77,056 KB
testcase_25 AC 138 ms
77,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, m, a):
    ans = 'Yes'
    for i in range(0, n - 1):
        if m - a[i] < 0 or (a[i] + a[i + 1]) - m < 0:
            ans = 'No'
    return ans       
for _ in range(int(input())):
    n, m = map(int,input().split())
    a = list(map(int,input().split()))

    print(solve(n, m, a))
0