如果要在一个位置插入多个值的话,可以不可以仅仅分裂一次然后疯狂往左子树上合并,最后再把右子树合并上
就像这样
void Insert() {
int nowl, nowr, now;
pos = read();
split(root, pos, nowl, nowr);
cnt = read();
for (int i = 1; i <= cnt; i++) {
int x = read();
create(now, x);
nowl= merge(nowl, now);
}
root = merge(nowl, nowr);
}