最開始以為和多邊形的重心有關,後來發現多邊形的重心沒啥好玩的性質
實際上你把面積小於的不等式列出來,發現是一次的,那麼就可以半平面交了
code:
#include #include #include #define vector point
const int n=2e5+10;
const double eps=1e-7;
int n,m,l,r;
struct point
point(double x,double y)
double angle()
vector friend operator +(vector a,vector b)
vector friend operator -(vector a,vector b)
vector friend operator *(vector a,double b)
}bee[n],q1[n];
struct line
line(point s,point t)
}yuu[n],q2[n];
double cross(vector a,vector b)
bool isrig(line a,point b)
bool cmp(line a,line b){return fabs(a.ang-b.ang)eps)
{ while(l2019.3.4
SCOI2015 小凸想跑步
題目 先推一波式子,設 p x,y 那麼我們嘗試寫出點 x i,y i x y 和 p x,y 形成的三角形面積,就是用叉積寫一波 2s x i x y y x x y i y 大力拆開式子,發現 2s y y x x x i y x iy x y i 不難發現這是乙個 ax by c 的形式,肯定...
SCOI2015 小凸想跑步
半平面交 題目要求求出讓 delta pp 0p 1 在所有形成的三角形中面積最小 那麼可以考慮對於點 p x y p p 一定有 x x 1 y y 1 times x 0 x 1 y 0 y 1 x x i y y i times x x i y y i 那麼把式子化開就可以得到若干 ax by...
省選專練SCOI2015小凸想跑步
終於快把scoi練完了。毒瘤題這個題難點不在半平面交,在於推導 其次精度問題 eps 和inf 取值需謹慎。大了會丟精度,小了會炸精度。接著得開long double 於是流輸出。includeusing namespace std define double long double const d...