結果

問題 No.2757 Pin Game
ユーザー tkykwtnb
提出日時 2024-05-17 21:50:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 82,512 KB
実行使用メモリ 122,296 KB
最終ジャッジ日時 2024-12-20 13:35:05
合計ジャッジ時間 1,598 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
X=list(map(int,input().split()))
P=[1 for _ in range(N)]
l=0
r=1
while l<N-1:
    while r<N and X[r]-X[l]<K:
        P[r]=0;r+=1
    l=r
    r=l+1
print(sum(P))
0