답안 #112090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
112090 2019-05-17T11:42:42 Z jaberndc 원 고르기 (APIO18_circle_selection) C++14
컴파일 오류
0 ms 0 KB
#include<iostream>#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4  1#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#includalgorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 *include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#ilude<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{	int x,y,r,i;	int used=0;};bool comp(circle a,circle b){	if(a.r==b.r) return a.i<b.i;	return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){	double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);	if(d<=(a.r+b.r)*(a.r+b.r)) return true;	return false;}int main(){	int n;	cin>>n;	for(int i=1;i<=n;i++)	{		cin>>c[i].x>>c[i].y>>c[i].r;		c[i].i=i;	}	sort(c+1,c+n+1,comp);	for(int i=1;i<=n;i++)	{		if(c[i].used) continue;		ans[c[i].i]=c[i].i;		c[i].used=1;		int start=i+1;		for(int j=start;j<=n;j++)		{			if(c[j].used) continue;			if(intrsct(c[i],c[j]))			{				//cout<<c[j].i<<endl;				ans[c[j].i]=c[i].i;				c[j].used=1;			}		}	}	for(int i=1;i<=n;i++)	{		cout<<ans[i]<<" ";	}}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/

Compilation message

circle_selection.cpp:1:19: warning: extra tokens at end of #include directive
 #include<iostream>#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4  1#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#includalgorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 */#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 *include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#ilude<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/#include<algorithm>#include<math.h>using namespace std;int ans[3005];struct circle{ int x,y,r,i; int used=0;};bool comp(circle a,circle b){ if(a.r==b.r) return a.i<b.i; return a.r>b.r;}circle c[3005];bool intrsct(circle a,circle b){ double d=(a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); if(d<=(a.r+b.r)*(a.r+b.r)) return true; return false;}int main(){ int n; cin>>n; for(int i=1;i<=n;i++) {  cin>>c[i].x>>c[i].y>>c[i].r;  c[i].i=i; } sort(c+1,c+n+1,comp); for(int i=1;i<=n;i++) {  if(c[i].used) continue;  ans[c[i].i]=c[i].i;  c[i].used=1;  int start=i+1;  for(int j=start;j<=n;j++)  {   if(c[j].used) continue;   if(intrsct(c[i],c[j]))   {    //cout<<c[j].i<<endl;    ans[c[j].i]=c[i].i;    c[j].used=1;   }  } } for(int i=1;i<=n;i++) {  cout<<ans[i]<<" "; }}/*119 9 213 2 111 8 23 3 23 12 112 14 19 8 52 8 25 2 114 4 214 14 1*/
                   ^
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status