【经典】半平面交求解方程组——poj1755
神坑,精度要调到1e-10,板子没问题 /* 二分距离,凸包所有边往左平移这个距离,半平面交后看是否还有核存在 */ #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> #include<queue> using namespace std; #define N 205 typedef double db; const db eps=1e-10; const db inf=1e10; const db pi=acos(-1.0); int sign(db k){ if (k>eps) return 1; else if (k<-eps) return -1; return 0; } int cmp(db k1,db k2){return sign(k1-k2);} int inmid(db k1,db k2,db k3){return sign(k1-k3)*sign(k2-k3)<=0;}// k3 在 [k1,k2] 内 struct point{ db x,y; point(){} point(db x,db y):x(x),y(y){} point operator + (const point &k1)