結果

問題 No.2757 Pin Game
ユーザー Yuyo1984
提出日時 2024-05-17 22:39:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 270 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,328 KB
最終ジャッジ日時 2024-12-20 14:40:49
合計ジャッジ時間 2,262 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 3 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
x = list(map(int, input().split()))
ans = n
i = 0
j = 1
while True:
    l = x[i]
    r = x[j]
    if i >= n-1 or j >= n-1:
        break
    if r - l < k:
        ans -= 1
        j += 1
    else:
        i = j
        j += 1

print(ans)
0