半平面交 poj 2451

poj 2451

 

#pragma GCC optimize(2)
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include 
#define lowbit(x) (x&(-x))
#define inf  0x7fffffff
#define linf 0x7fffffffffffffff
#define mem(x,y) memset(x,y,sizeof(x))
#define fup(i,x,y) for(int i=(x);i<=(y);i++)
#define fdn(i,x,y) for(int i=(x);i>=(y);i--)
#define sp(x) setprecision(x)
#define sd(n) scanf("%d",&n)
#define sdd(n,m) scanf("%d%d",&n,&m)
#define sddd(n,m,k) scanf("%d%d%d",&n,&m,&k)
#define sld(n) scanf("%lld",&n)
#define sldd(n,m) scanf("%lld%lld",&n,&m)
#define slddd(n,m,k) scanf("%lld%lld%lld",&n,&m,&k)
#define sf(n) scanf("%lf",&n)
#define sff(n,m) scanf("%lf%lf",&n,&m)
#define sfff(n,m,k) scanf("%lf%lf%lf",&n,&m,&k)
#define sc(n) scanf("%s",n)
#define pf(x) printf("%d\n",x)
#define pfl(x) printf("%lld\n",x)
#define pff(x) printf("%lf\n",x)
#define debug printf("!!\n");
#define N 20005
#define M 4000009
#define pi acos(-1)
#define eps 1e-8
//cout.setf(ios::fixed);
//freopen("out.txt","w",stdout);// freopen("in.txt","r",stdin);
using namespace std;
typedef unsigned long long  ll;
typedef long long  LL;
typedef double db;
int dcmp(double x) {
    if (x<=eps&&x>=-eps) return 0;
    return (x>0)?1:-1;
}
struct Vector {
    double x,y;
    Vector(double X=0,double Y=0){
        x=X,y=Y;
    }
};
typedef Vector Point;

struct Line {
    Point p;
    Vector v;
    double ang;
    Line(Point P=Point(0,0),Vector V=Vector(0,0)) {
        p=P,v=V;
        ang=atan2(v.y,v.x);
    }
    bool operator < (const Line &a) const {
        return ang=0;
}
void halfp(){
    sort(L+1,L+n+1);
    cnt=0;
    q[l=r=1]=L[1];
    for (int i=2;i<=n;++i) {
        while (l

 

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