Peter and Snow Blower CodeForces - 613A (点到线段距离)

大意: 给定多边形, 给定点$P$, 求一个以$P$为圆心的最小的圆环包含整个多边形.

 

#include 
#include 
#define REP(i,a,b) for(int i=a;i<=b;i++)

const double eps=1e-8;

int dcmp(double x) {return fabs(x)<=eps?0:x>eps?1:-1;}

const int N = 1e5+10;
struct Point {
	double x,y;
	Point(double x=0,double y=0):x(x),y(y) {}
	Point operator + (const Point &a) {return Point(x+a.x,y+a.y);}
	Point operator - (const Point &a) {return Point(a.x-x,a.y-y);}
	Point operator * (double a) {return Point(x*a,y*a);}
	Point operator / (double a) {return Point(x/a,y/a);}
	bool operator < (const Point &b) const {return x0)return v3.length();
	else return DistanceToLine(p,a,b);
}

double Area(int n,Point* P) {
	double ans=0;
	for(int i=2; i

 

转载于:https://www.cnblogs.com/uid001/p/10853127.html

你可能感兴趣的:(Peter and Snow Blower CodeForces - 613A (点到线段距离))