救救我!!!70pts
查看原帖
救救我!!!70pts
987871
hopelessness楼主2023/10/12 15:45

70pts \

Code
/*
	by hopelessness
*/
#include<bits/stdc++.h>

#define il inline
#define MAXN 2020
#define LL long long
#define mod 19491001
#define ri register int

using namespace std;

struct Luogu_is_my_god {
	int x,y;
} luo[MAXN];

struct Matrix {
	__int128_t x,xx,y,yy;
	double len,central_x,central_y;
} LOJ[MAXN*MAXN];

const double eps=1e-25;

int n,tot;
__int128_t ans;

template<typename T>il void read(T &x) {
	char c=getchar();
	x=0;
	int f=0;
	for(; !isdigit(c); c=getchar()) f|=(c=='-');
	for(; isdigit(c); c=getchar()) x=((x<<3)+(x<<1)+(c^48));
	x=f?-x:x;
}
template<typename T>il void write(T x) {
	if(x<0) x=-x,putchar('-');
	if(x>9) write(x/10);
	putchar(x%10^48);
}
il double Len(double x,double y,double xx,double yy) {
	return sqrt((x-xx)*(x-xx)+(y-yy)*(y-yy));
}
il bool operator < (Matrix a,Matrix b) {
	if(a.central_x!=b.central_x) return a.central_x < b.central_x;
	else if(a.central_y!=b.central_y) return a.central_y < b.central_y;
	else return a.len < b.len;
}

int main() {
//	freopen("num.in","r",stdin);
//	freopen("num.out","w",stdout);
	read(n);
	for(ri i=1; i<=n; i=-~i) read(luo[i].x),read(luo[i].y);
	for(ri i=1; i<=n; i=-~i) {
		for(ri j=i+1; j<=n; j=-~j) {
			LOJ[++tot].len=Len(luo[i].x,luo[i].y,luo[j].x,luo[j].y);
			LOJ[tot].central_x=(double)(1.0*luo[i].x+1.0*luo[j].x)/2.0;
			LOJ[tot].central_y=(double)(1.0*luo[i].y+1.0*luo[j].y)/2.0;
			LOJ[tot].x=luo[i].x;
			LOJ[tot].y=luo[i].y;
			LOJ[tot].xx=luo[j].x;
			LOJ[tot].yy=luo[j].y;
		}
	}
	sort(LOJ+1,LOJ+tot+1);
//	printf("%d\n",tot);
	for(ri i=2; i<=tot; i=-~i) {
		if(fabs(LOJ[i].central_x-LOJ[i-1].central_x)<=0&&fabs(LOJ[i].central_y-LOJ[i-1].central_y)<=0&&fabs(LOJ[i].len-LOJ[i-1].len)<=eps) {
//			double len1=Len(LOJ[i].x,LOJ[i].y,LOJ[i-1].x,LOJ[i-1].x);
			double len1=(LOJ[i].x-LOJ[i-1].x)*(LOJ[i].x-LOJ[i-1].x)+(LOJ[i].y-LOJ[i-1].y)*(LOJ[i].y-LOJ[i-1].y);
//			double len2=Len(LOJ[i].xx,LOJ[i].yy,LOJ[i-1].x,LOJ[i-1].x);
			double len2=(LOJ[i].xx-LOJ[i-1].x)*(LOJ[i].xx-LOJ[i-1].x)+(LOJ[i].yy-LOJ[i-1].y)*(LOJ[i].yy-LOJ[i-1].y);
			__int128_t num=sqrt(len1*len2);
			if(ans<num) ans=num;
//			printf("???\n");
		}
	}
	write(ans),putchar('\n');
	return 0;
}
/*
8
-2 3
-2 -1
0 3
0 -1
1 -1
2 1
-3 1
-2 1
-----
10
*/

```cpp
2023/10/12 15:45
加载中...