-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
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
[内容有误] 后缀平衡树参考代码被 hack #4979
Comments
感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~ |
UPD:参考代码在第 R[fa] = L[nrt];
L[nrt] = L[rt];
R[nrt] = R[rt]; |
来个pr? |
等下,我再确认一下有没有其他问题(我这还是拍挂了) |
UPD:我发现似乎用 SGT 来维护后缀平衡树的思路是非常假的,主要问题在于删除操作后没有能够快速保证 tag 合法的维护方式。我粗略考虑了一下感觉懒惰删除似乎是可行的,但代码需要进行大改。 |
可以参考 The suffix binary search tree and suffix AVL tree 这篇论文对这个页面重构一下。陈立杰论文里面的描述有点简略,并且没有参考文献,感觉应该谨慎选择。 |
我感觉tag等价于从根到叶子的路径,所以要让tag有效就等价于其路径在合法的时间内不变,所以采用完全不旋转的sgt吧。 |
*根到叶子的路径完全不会被改动的方案。 |
是的,所以这种方案就是懒惰删除😂 |
我在 #5083 里用的是积极删除,因为这个场景其实很难懒惰(因为每个节点需要和序列的位置对应)。你可以看看? |
请选择:
我正在访问这个页面
https://oi-wiki.org/string/suffix-bst/
我发现页面有这样的问题
参考代码 wa 了,hack 数据:
最后一个输出正确答案为
35
,参考代码输出为37
。暂时没时间帮忙 debug,希望有其他人修(
The text was updated successfully, but these errors were encountered: