結果

問題 No.2757 Pin Game
ユーザー kotatsugame
提出日時 2024-05-17 21:20:55
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 63,100 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-20 13:07:27
合計ジャッジ時間 1,372 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cassert>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N,K;
	cin>>N>>K;
	int prv=-2e9;
	int cnt=0;
	for(int i=0;i<N;i++)
	{
		int X;cin>>X;
		if(prv+K<=X)prv=X,cnt++;
	}
	cout<<cnt<<endl;
}
0