結果

問題 No.2803 Bocching Star
ユーザー cho435cho435
提出日時 2024-07-12 21:52:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 981 bytes
コンパイル時間 4,367 ms
コンパイル使用メモリ 266,648 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-12 21:53:02
合計ジャッジ時間 7,239 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 9 ms
6,944 KB
testcase_04 AC 48 ms
6,944 KB
testcase_05 AC 25 ms
6,940 KB
testcase_06 AC 6 ms
6,940 KB
testcase_07 AC 20 ms
6,940 KB
testcase_08 AC 10 ms
6,940 KB
testcase_09 AC 44 ms
6,944 KB
testcase_10 AC 49 ms
6,940 KB
testcase_11 AC 55 ms
6,944 KB
testcase_12 AC 18 ms
6,940 KB
testcase_13 AC 39 ms
6,940 KB
testcase_14 AC 25 ms
6,944 KB
testcase_15 AC 56 ms
6,944 KB
testcase_16 AC 31 ms
6,940 KB
testcase_17 AC 10 ms
6,944 KB
testcase_18 AC 8 ms
6,940 KB
testcase_19 AC 40 ms
6,944 KB
testcase_20 AC 27 ms
6,940 KB
testcase_21 AC 21 ms
6,940 KB
testcase_22 AC 22 ms
6,940 KB
testcase_23 AC 54 ms
6,944 KB
testcase_24 AC 71 ms
6,944 KB
testcase_25 AC 65 ms
6,940 KB
testcase_26 AC 68 ms
6,944 KB
testcase_27 AC 56 ms
6,940 KB
testcase_28 AC 61 ms
6,944 KB
testcase_29 AC 56 ms
6,940 KB
testcase_30 AC 70 ms
6,940 KB
testcase_31 AC 53 ms
6,944 KB
testcase_32 AC 74 ms
6,940 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)

template<typename T>
bool chmin(T &x, T y) { return x > y ? (x = y, true) : false; }
template<typename T>
bool chmax(T &x, T y) { return x < y ? (x = y, true) : false; }

struct io_setup {
	io_setup() {
		ios::sync_with_stdio(false);
		std::cin.tie(nullptr);
		cout << fixed << setprecision(15);
	}
} io_setup;

using mint = atcoder::modint1000000007;

int main(){
	int n,s;
	cin>>n>>s;
	vector<int> p(n);
	rep(i,0,n) cin>>p.at(i);
	vector<int> q(n);
	iota(q.begin(),q.end(),0);
	sort(q.begin(),q.end(),[&](int i,int j){return p.at(i)<p.at(j);});
	vector<int> ans;
	rep(i,0,n){
		int flg=0;
		if(i>0&&p.at(q.at(i-1))+s>=p.at(q.at(i))) flg=1;
		if(i<n-1&&p.at(q.at(i))+s>=p.at(q.at(i+1))) flg=1;
		if(!flg) ans.push_back(q.at(i));
	}
	sort(ans.begin(),ans.end());
	cout<<ans.size()<<"\n";
	for(int x:ans) cout<<x+1<<" ";
	cout<<"\n";
}
0