64pts,求调
查看原帖
64pts,求调
1392543
_X_Z_N_楼主2024/7/25 19:13
#include<bits/stdc++.h>
using namespace std;
struct point
{
	double x,y;
};
bool cmp(point a,point b)
{
	if(a.x==b.x)
		return a.y<b.y;
	return a.x<b.x;
}
point p[20005];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		double x,y;
		cin>>x>>y;
		p[i].x=x;
		p[i].y=y;
	}
	sort(p+1,p+n+1,cmp);
	point t;
	t.x=(p[1].x+p[n].x)/2;
	t.y=(p[1].y+p[n].y)/2;
	for(int i=1;i<=(n+1)/2;i++)
	{
		point po;
		po.x=(p[i].x+p[n-i+1].x)/2;
		po.y=(p[i].y+p[n-i+1].y)/2;
		if(t.x!=po.x||t.y!=po.y)
		{
			printf("This is a dangerous situation.");
			return 0;
		}
	}
	cout<<"V.I.P. should stay at (";
	printf("%.1lf",t.x);
	cout<<",";
	printf("%.1lf",t.y);
	cout<<").";
	return 0;
} 

3,4,6,9WA

2024/7/25 19:13
加载中...