hdu3487 Play with Chain
维护无序序列。结点信息包括flip和s。
cut操作:
void cut(int a, int b, int c) { Node *left, *mid, *right, *o; split(ss.root, a, left, o); split(o, b-a+1, mid, right); ss.root = merge(left, right); split(ss.root, c+1, left, right); ss.root = merge(merge(left, mid), right); }