cdq+树状数组套替罪羊树. cdq归并a,树套树解决b,c. 记住平衡树树根不能暴力清零!!! // It is made by XZZ #include<cstdio> #include<algorithm> #define Fname "partial_order" using namespace std; #define rep(a,b,c) for(rg int a=b;a<=c;a++) #define drep(a,b,c) for(rg i…
COGS2479:四维偏序. CDQ套CDQ CDQ:对a分治,对b排序,再对a打标记,然后执行CDQ2 CDQ2:对b分治,对c归并排序,对d树状数组. #include<cstdio> #include<algorithm> #define rep(i,l,r) for (int i=l; i<=r; i++) using namespace std; typedef long long ll; ; int n,ans,c[N]; struct P{ int a,b,c,…