結果

問題 No.2757 Pin Game
ユーザー トミートミー
提出日時 2024-05-17 21:37:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 134,580 KB
最終ジャッジ日時 2024-05-17 21:37:31
合計ジャッジ時間 1,537 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
54,144 KB
testcase_01 AC 37 ms
54,720 KB
testcase_02 AC 36 ms
54,540 KB
testcase_03 AC 35 ms
54,828 KB
testcase_04 WA -
testcase_05 AC 117 ms
122,080 KB
testcase_06 AC 62 ms
54,700 KB
testcase_07 AC 36 ms
54,592 KB
testcase_08 AC 36 ms
54,396 KB
testcase_09 WA -
testcase_10 AC 86 ms
93,300 KB
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
def main():
    n,k=map(int,input().split())
    x=list(map(int,input().split()))
    l=deque()
    for i in range(len(x)-1):
        l.append(x[i+1]-x[i])
    cnt=0
    while len(l)!=0:
        tmp=l.popleft()
        if tmp<k:
            if len(l)!=0:
                l[0]+=tmp
            else:
                cnt+=1
            cnt+=1
        else:
            pass
    print(n-cnt)
            
            
if __name__ == "__main__":
    main()
0