无序序列,两种操作:单点修改,区间查询最大值~
void query_max(int a, int b) { Node *left, *mid, *right, *o; split(ss.root, a, left, o); split(o, b-a+1, mid, right); printf ( "%d ", mid->ma ); ss.root = merge(merge(left, mid), right); } void update(int a, int b) { Node *left, *mid, *right, *o; split(ss.root, a, left, o); split(o, 1, mid, right); mid->v = b; mid->ma = b; mid->lazy = b; ss.root = merge(merge(left, mid), right); }