#include<bits/stdc++.h> using namespace std; #define N 500010 vector<int>c,x,y; int n,m,p,ct,vi[N],w,rt; void bd(int &o,int c){ o=++ct; if(c==2)return; int tp=c/2; if(tp>w)bd(x[o-1],tp),x[o-1]*=-1; else{ w-=tp; x[o-1]=-rt; } }
#include<bits/stdc++.h> using namespace std; #define N 500010 vector<int>c,x,y; int n,m,p,ct,vi[N],w,rt; void bd(int &o,int c){ o=++ct; if(c==2)return; int tp=c/2; if(tp>w)bd(x[o-1],tp),x[o-1]*=-1; else{ w-=tp; x[o-1]=-rt; } }
转载于:https://www.cnblogs.com/rilisoft/p/11594509.html