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

点分治的acwing的树那题代码有点点bug #83

Open
yuanz4 opened this issue Feb 12, 2023 · 1 comment
Open

点分治的acwing的树那题代码有点点bug #83

yuanz4 opened this issue Feb 12, 2023 · 1 comment

Comments

@yuanz4
Copy link

yuanz4 commented Feb 12, 2023

这个解答,这里第75行的s[y]是在找树的重心时求出来的,是以x(假定的根)为根时每个子树的大小,并不是以真正的重心为根时的子树大小,所以这个s应该是错的,得要以pos为根重新求。可以在dfs的那个function里面求

验证过了,work中的S确实不能反映子树真正的大小

@tabbbbbb
Copy link

tabbbbbb commented Feb 12, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants