We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http://oi-wiki.com/ds/odt/
split
n
The text was updated successfully, but these errors were encountered:
要是给我改的话,我想把整个 split 前半部分改成下面这种情况,这样看起来只需要像线段树一样,在初始化时加一个超大区间,并将赋予该区间一个特殊值,就能避免产生对不在树上的区间进行 split 的问题:
auto split(int x) { auto iter = odt.lower_bound(Node_t(x, 0, 0)); if(iter != odt.end() && iter->left == x) return iter; --iter; ...... }
Sorry, something went wrong.
是upper_bound吧
upper_bound
--upper_bound 是最后一个 lower_bound, 是不是这样就能把所有重复的右边界都包括进去
--upper_bound
lower_bound
感觉主要思想并没有阐述很清楚,是因为竞赛里都会卡这个,所以没有学习的必要了吗。。。作为一个面向面试的学习者,遇到区间修改的时候写这个很明显比写树状数组或线段树要快很多的样子。。。
No branches or pull requests
请选择:
我正在访问这个页面
http://oi-wiki.com/ds/odt/
我发现页面有这样的问题
split
中的变量n
并未注明含义split
的值目前并不在树上会产生错误The text was updated successfully, but these errors were encountered: