#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
const int MAXN = 100022 << 2;
struct Point
{
int x, y;
Point( int x = 0, int y = 0 ):x(x), y(y) { }
};
typedef Point Vector;
Vector operator+( Vector A, Vector B ) //向量加
{
return Vector( A.x + B.x, A.y + B.y );
}
Vector operator-( Vector A, Vector B ) //向量减
{
return Vector( A.x - B.x, A.y - B.y );
}
Vector operator*( Vector A, double p ) //向量数乘
{
return Vector( A.x * p, A.y * p );
}
Vector operator/( Vector A, double p ) //向量数除
{
return Vector( A.x / p, A.y / p );
}
bool operator<( const Point& A, const Point& B ) //两点比较
{
return A.x < B.x || ( A.x == B.x && A.y < B.y );
}
double Cross( Vector A, Vector B ) //向量叉积
{
return A.x * B.y - A.y * B.x;
}
//求凸包
int ConvexHull( Point *p, int n, Point *ch )
{
sort( p, p + n );
int m =
旋转卡壳模版(求凸包直径)
最新推荐文章于 2020-03-08 14:16:45 发布