Skip to content
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

[内容有误] 数据结构——并查集——路径压缩的C++实现代码有误 #4566

Closed
1 task
Chiichen opened this issue Jan 3, 2023 · 2 comments
Closed
1 task
Labels
Content Bug / 页面内容有误 Something isn't working help wanted / 需要帮助 Extra attention is needed

Comments

@Chiichen
Copy link

Chiichen commented Jan 3, 2023

请选择:

  • 我正在着手修复这个问题

我正在访问这个页面

https://oi-wiki.org/ds/dsu/

我发现页面有这样的问题

image

含路径压缩的C++实现代码与上面不含路径压缩的代码一样,python代码无误

@Chiichen Chiichen added Content Bug / 页面内容有误 Something isn't working help wanted / 需要帮助 Extra attention is needed labels Jan 3, 2023
@welcome
Copy link

welcome bot commented Jan 3, 2023

感谢你对 OI Wiki 的关注!记得在 Issue 中表达清楚自己的意思哦~

@Tiphereth-A
Copy link
Member

-size_t dsu::find(size_t x) { return pa[x] == x ? x : find(pa[x]); }
+size_t dsu::find(size_t x) { return pa[x] == x ? x : pa[x] = find(pa[x]); }

@Tiphereth-A Tiphereth-A closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content Bug / 页面内容有误 Something isn't working help wanted / 需要帮助 Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants