真●半平面交,半平面交模板题,按照题目描述将每个多边形拆分成n个向量,我们规定向量的左侧为其指定的区域,参照了Po姐的写法,因为双端队列实在是不好搞,我们先在一个方向加线,然后再在最后删队首队尾,值得注意的是用向量求交点和用向量判断一个点是否在这条向量的左面。
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<iostream>
#include<iomanip>
#include<ctime>
#include<cmath>
#include<algorithm>
using namespace std;
struct point
{
double x,y;
point(){}
point(double _,double __):x(_),y(__){}
point operator + (point b)
{
return point(x+b.x,y+b.y);
}
point operator - (point b)
{
return po