-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Line Tree? #1251
Comments
As for the setting, it is similar to the problem found here, but since this is a special solution for the min/max case, I need to create a new problem. Therefore, I’m thinking of adding a new problem. It doesn’t seem necessary for the graph to be a tree, so how about considering the following problem? Given a connected graph with
Constraints |
BTW This should be lower priority IMO because the oj-verify tool supports aizu judge, and there's this problem https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_12_A which you can run line tree against the naive (low bounds) |
oh, I noticed you have n-1<=m, but the code I have for line tree works when there's multiple components (in this case, it returns a set of linked lists) |
where uf.find(v) = head of linked list of that component |
oh BTW I couldn't figure out the O(n) (after sorting edges), mentioned in that comment :( I would be very interested if you know how it's done my only observation is when you merge 2 lists into 1, you can choose to reverse either list I also tried applying this A Linear-Time Algorithm for a Special Case |
I only know the O(N\alpha(N)) solution. |
I suggest adding the constraint that the graph is connected, as it simplifies the problem statement and has minimal impact on the solution. |
Can you add a problem which can test https://codeforces.com/blog/entry/71568?#comment-559304 ?
Like maybe: given a weighted, unrooted tree, answer queries of: given u,v find max edge weight on path from u to v
The text was updated successfully, but these errors were encountered: