裸平衡树,恢复手感用的 //By BLADEVIL var n :longint; i :longint; x, y :longint; t, tot :longint; key, s, left, right :..] of longint; ft :longint; a, b :longint; ans :longint; procedure right_rotate(var t:longint); var k :longint; begin k:=left[t]; left[t]:=rig…
cogs62 [HNOI2004] 宠物收养所 啦啦啦啦 不维护区间的平衡树题都是树状数组+二分练手题! 不会的参考我的普通平衡树的多种神奇解法之BIT+二分答案 // It is made by XZZ #include<cstdio> #include<algorithm> using namespace std; #define rep(a,b,c) for(rg int a=b;a<=c;a++) #define drep(a,b,c) for(rg int a=b;…