Help required in debugging solution for problem 160D (Edges on MST)

Revision en1, by winxtron, 2020-10-15 22:22:08

Hi codeforces! I have been trying this problem (160 D) for quite some while now, and my solution repeatedly TLEs on test case 22. (specifically a case where there are 1e5 edges and all edges are of the same weight.) I have tried debugging it for quite some while now, but am absolutely clueless as to why it TLEs. Could someone please help me out with it?

I am bluntly attaching my code here, which I have commented a bit in an attempt to make it appear a little less junk. Though my code is commented, I am willing to explain any part of my solution in case someone wants it. Any sort of help will be appreciated. :)

PS: Yeah, even I hate debugging blogs, but please have a look at my solution once before downvoting. :) thx.

SOLUTION LINK: 95615534

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English winxtron 2020-10-15 22:25:33 0 (published)
en3 English winxtron 2020-10-15 22:25:19 9 (saved to drafts)
en2 English winxtron 2020-10-15 22:23:01 162 (published)
en1 English winxtron 2020-10-15 22:22:08 887 Initial revision (saved to drafts)