如果你翻转区间时是这么分裂的:
split(root,l-1,dl,dr); split(dr,r,dx,dr);
应改为:
split(root,r,dl,dr); split(dl,l-1,dl,dx);
原因是先分前面时,后面的排名会发生变化,所以会出错。