k-d tree + 重构的思想,就能卡过luogu和bzoj啦orz #include <algorithm> #include <iostream> #include <cstdio> using namespace std; int n, m, rot, nowD, opt, uu, vv, ans, rub[1000005], din, cur; const double aph=0.65; struct Point{ int d[2], mn[2], mx[2…
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; #define N 500001 #define INF 2147483647 #define KD 2//ά¶ÈÊý int qp[KD],disn; int n,root; bool dn; struct Node { int minn[KD],maxx[KD],p[KD]; int ch[2]; void Init(…