結果

問題 No.2757 Pin Game
ユーザー mizuha
提出日時 2024-07-21 11:07:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 44,316 KB
最終ジャッジ日時 2024-07-21 11:07:43
合計ジャッジ時間 2,346 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
X = list(map(int, input().split()))
count = 1
last_selected = X[0]
for i in range(1, N):
    if X[i] - last_selected >= K:
        count += 1
        last_selected = X[i]
print(count)
0