/**求出凸包枚举每个点的矩距离即可 因为凸包上的点可定不多。。学习: 刚开始WA 了一次,,因为用int 存的, 一看discuss 里提供的数据,想起来,,应该是越界了。。后来用longlong 就过了。。**/#include#include #include using namespace std;struct point { long long x,y; //point (){} point (double x=0,double y=0):x(x),y(y){}};point p[50050],ch[50050];typedef point Vector;Vector operator -(point a,point b){ return Vector (a.x-b.x,a.y-b.y);}long long cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x;}bool cmp(point a,point b){ if(a.x==b.x) return a.y 1&&cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0) m--; ch[m++] = p[i]; } int k = m; for(int i=n-2;i>=0;i--){ while(m>k&&cross(ch[m-1]-ch[m-2],p[i]-ch[m-2])<=0) m--; ch[m++] = p[i]; } if(n>1) m--; return m;}int main(){ int n; cin>>n; for(int i=0;i >p[i].x>>p[i].y; } int m = convexHull(p,n,ch); long long max_len = 0; for(int i=0;i max_len) max_len = length(ch[j]-ch[i]); } } cout< <