struct node{
int x,y;
friend ll operator *(const node A,const node B){
return 1ll*A.x*B.y-1ll*A.y*B.x;
}
friend node operator+(const node A,const node B){
return {A.x+B.x,A.y+B.y};
}
friend node operator-(const node A,const node B){
return {A.x-B.x,A.y-B.y};
}
friend bool operator ==(const node A,const node B){
return A.x==B.x&&A.y==B.y;
}
inline long double ang(){
return atan2(y,x);
}
}A[600300];
vector<int>g[600300],P[600300];
inline bool chk(int id,node T){
int k=P[id].size();
for(int i=0;i+1<k;i++)
if((A[P[id][i+1]]-A[P[id][i]])*(T-A[P[id][i]])<=0)return 0;
return 1;
}
我在预处理的时候做过 P[s].push_back(P[s][0])
,同时 P[id]
是逆时针顺序的。
但是这个东西我拿去某个题的暴力的时候他好像寄了,基本能确定是这里的问题。有无大佬给看看。