[CQOI 2006] 凸多边形

 
  
半平面交裸题
 
  
//By Richard
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define rep(x,y,z) for (int x=(y);(x)<=(z);(x)++)
#define per(x,y,z) for (int x=(y);(x)>=(z);(x)--)
#define log2(x) (31-__builtin_clz(x))
#define mod (int)(1e9+7)
#define inf 0x3f3f3f3f
#define cls(x) memset(x,0,sizeof(x))
#ifdef DEBUG
#define debugdo(X) X
#define debugndo(X)
#define debugout(X) cout<<(#X)<<"="<<(X)< pairs;
typedef long long LL;
const double eps=0.000000001,pi=3.1415926535897932384626433832795028841971693993751058209749446;
/////////////////////read4.0////////////////////////////////////
template 
inline void read(T &x){char ch;x=0;bool flag=false;ch=getchar();while (ch>'9'||ch<'0') {if (ch=='-') flag=true;ch=getchar();}while ((ch<='9'&&ch>='0')){x=x*10+ch-'0';ch=getchar();}if (flag) x*=-1;}
template 
inline void read(T &x,T &y){read(x);read(y);}
template 
inline void read(T &x,T &y,T &z){read(x);read(y);read(z);}
/////////////////variables&functions////////////////////
const int maxn=555;
int n,cnt,tot,m;
double x,y;
#define angel angle
struct Point
{
	double x,y;
	Point(double a=0,double b=0):x(a),y(b){}
	inline Point operator-(const Point &b)const{return Point(x-b.x,y-b.y);}
	inline double operator*(const Point &b)const{return x*b.y-y*b.x;}
}res[maxn];
inline double mul(Point a,Point b,Point c){return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);}
struct Line
{
	Point x,y;
	double angle;
	Line(Point a=Point(0,0),Point b=Point(0,0),double c=0):x(a),y(b),angel(c){}
	inline bool operator<(const Line &b)const{return abs(angel-b.angel)0:angle


你可能感兴趣的:(计算几何)