rt
此处的 tree 指
pd::tree<pi,pd::null_type,less<pi>,pd::rb_tree_tag,pd::tree_order_statistics_node_update>
起因是在写 P3224 的时候发现使用 join 会 RE,看到题解和讨论区都说到 被加入的数都必须小于加入的树中的树才可以使用 join,但是这段代码:
st[0].insert(1);
st[1].insert(2);
st[0].join(st[1]);
和
st[0].insert(2);
st[1].insert(1);
st[0].join(st[1]);
均不会 RE。
而官方文档原文是
A join cannot be performed logical reasons (i.e., the ranges of the two container objects being joined overlaps.
也写得含糊不清,所以求问一下,一般在什么时候可以使用 join。