結果
問題 | No.2757 Pin Game |
ユーザー |
|
提出日時 | 2024-05-30 22:46:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 143 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 1,695 ms |
コンパイル使用メモリ | 189,468 KB |
最終ジャッジ日時 | 2025-02-21 17:09:45 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 |
ソースコード
#include<bits/stdc++.h>#define pt printf(">>>")#define mid (((l)+(r))/2)using namespace std;typedef long long ll;typedef long double ld;const ll N=1e6+10,inf=1e18+10,mod=1e9+7;ll n,k,x[N];int main(){cin >> n >> k;ll now=-inf,ans=0;for(ll i=1;i<=n;i++){cin >> x[i];if(x[i]-now>=k)ans++,now=x[i];}cout << ans;return 0;}