We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- All Contests
- HourRank 22
- Super Mancunian
- Discussions
Super Mancunian
Super Mancunian
Sort by
recency
|
20 Discussions
|
Please Login in order to post a comment
Finally I solved it. It took a few days to understand that several tests failed for timeout because I was using a slow implementation of UnionFind O(N). As soon as I switched to QuickUnionUF O(logN) all the tests became green.
http://vancexu.github.io/2015/07/13/intro-to-union-find-data-structure.html
I am getting segmentation fault in all the test cases except one.Is it because my solution uses too much space or there is any other mistake in it.
Is this test case giving the correct answer?
5 5 1 2 1 2 3 2 2 4 2 3 4 2 5 3 3
Shouldn't the output be 5 3 instead of 5 1
Hey guys I'm getting only 24.38 points. Here is a psuedo code of mine.
And I print Minimum_Cost and Count.
In case the problem was more generalized, say that the level we start from will also be given as input (and not LEVEL 1 by default as in this problem), would we get the solution by using All-Pairs-Shortest-Path and our answer would be count of all the edges having weight equal to the maximum weight in the graph?