結果

問題 No.2015 Stair Counter
ユーザー tassei903tassei903
提出日時 2022-07-22 21:44:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 106,816 KB
最終ジャッジ日時 2023-09-17 09:28:16
合計ジャッジ時間 4,910 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,112 KB
testcase_01 AC 111 ms
77,048 KB
testcase_02 AC 126 ms
77,292 KB
testcase_03 AC 120 ms
77,132 KB
testcase_04 AC 113 ms
77,120 KB
testcase_05 AC 114 ms
77,768 KB
testcase_06 AC 120 ms
76,976 KB
testcase_07 AC 117 ms
77,296 KB
testcase_08 AC 118 ms
77,200 KB
testcase_09 AC 91 ms
76,720 KB
testcase_10 AC 92 ms
76,468 KB
testcase_11 AC 92 ms
76,556 KB
testcase_12 AC 88 ms
76,884 KB
testcase_13 AC 95 ms
77,468 KB
testcase_14 AC 96 ms
78,680 KB
testcase_15 AC 103 ms
94,360 KB
testcase_16 AC 115 ms
103,640 KB
testcase_17 AC 104 ms
97,572 KB
testcase_18 AC 110 ms
97,744 KB
testcase_19 AC 119 ms
106,816 KB
testcase_20 AC 111 ms
104,096 KB
testcase_21 AC 111 ms
77,404 KB
testcase_22 AC 119 ms
77,268 KB
testcase_23 AC 116 ms
77,000 KB
testcase_24 AC 113 ms
76,976 KB
testcase_25 AC 116 ms
77,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
for _ in range(ni()):
    n, m = na()
    a = na()
    ans = 1
    x, y = 0, m
    for i in range(n):
        if x <= a[i] <= x + y:
            x, y = y-(a[i]-x),a[i]
        else:
            ans = 0
            break
        #print(x,y)
    if ans:
        Yes()
    else:
        No()
0