BZOJ3282 Tree
LCT的简单题。好久不写都手生了,还把rotate写错了一点点,导致找了半天错。 #include <cstdio> #include <cctype> #include <cstring> #include <algorithm> using namespace std; int _d_; #define readInt(_s_) {\ _s_ = 0;\ while (!isdigit(_d_ = getchar()));\ while ((_s_ = _s_ * 10 + _d_ - 48), isdigit(_d_ = getchar()));\ } const int maxn = 300009; int n, m; int ls[maxn], rs[maxn], pt[maxn], rv[maxn], vl[maxn], vs[maxn]; inline void update(const int& p) { vs[p] = vs[ls[p]] ^ vl[p] ^ vs[rs[p]]; } inline void fix(int p) { if (rv[p]) { swap(ls[p], rs[p]); if (ls[p])...