結果

問題 No.2757 Pin Game
ユーザー GOTKAKO
提出日時 2024-05-17 21:21:13
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 191,624 KB
最終ジャッジ日時 2025-02-21 14:25:23
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N,K; cin >> N >> K;
    long long back = -2e9,answer = 0;
    while(N--){
        long long x; cin >> x;
        if(x-back >= K) answer++,back = x;
    }
    cout << answer << endl;
}
0