結果

問題 No.2803 Bocching Star
ユーザー highlighter
提出日時 2024-06-15 13:12:11
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 469 bytes
コンパイル時間 2,589 ms
コンパイル使用メモリ 83,672 KB
実行使用メモリ 11,040 KB
最終ジャッジ日時 2024-07-05 10:29:11
合計ジャッジ時間 6,411 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 1 TLE * 1 -- * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<cmath>
#include<queue>
using namespace std;

int main(){
	int N,S;
	scanf("%d%d",&N,&S);
	int P[N];
	for(int i=0;i<N;i++){
		scanf("%d",&P[i]);
	}
	queue<int> que;
	for(int i=0;i<N;i++){
		bool check=true;
		for(int j=0;j<N;j++){
			if(i!=j && S>=abs(P[i]-P[j])){
				check=false;
				break;
			}
		}
		if(check){
			que.push(i+1);
		}
	}
	printf("%d\n",(int)(que.size()));
	while(!que.empty()){
		printf("%d ",que.front());
		que.pop();
	}
}
0