题目:
pdf:https://icpcarchive.ecs.baylor.edu/external/47/4728.pdf
给出n个正方形的左下角坐标和边长,求这些正方形的最远点对的距离,输出距离平方和
解题思路:
凸包直径--旋转卡壳裸题。
注意旋转卡壳算法在计算时凸包的点是逆时针的!!!
ac代码:
样例过了就是过了ʕ •ᴥ•ʔ
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int maxn = 400020;
struct Point
{
double x,y;
Point(double x=0,double y=0):x(x),y(y){}
friend bool operator < (Point a, Point b)
{
return a.x == b.x ? a.y < b.y : a.x < b.x;
}
};
typedef Poin