結果

問題 No.2757 Pin Game
ユーザー PyonPyon
提出日時 2024-05-17 21:31:18
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 3,605 ms
コンパイル使用メモリ 272,916 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-20 13:15:38
合計ジャッジ時間 4,618 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <atcoder/dsu>
#include <atcoder/segtree>
using namespace atcoder;
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
using vi = vector<int>; 
using vvi = vector<vi>; 
using li =vector<ll>;
using lli=vector<li>;
using si =vector<char>;
using ssi =vector<si>;
const long long INF = 1e18;
const long long MOD=1e9+7;
//for (auto [key, val] : mp)
int main() { 
ll n,k;cin>>n>>k;
ll ans=0;
ll now;
cin>>now;
rep(i,0,n-1){
	ll a;cin>>a;
	if(a-now<k)continue;
	else now=a;
	ans++;
}
cout<<ans+1;
}
0