Page 1 of 1

1010 - ACM contest and Blackout

Posted: Mon Feb 06, 2012 1:05 pm
by dovier

Re: 1010 - ACM contest and Blackout

Posted: Tue Sep 10, 2013 8:54 pm
by Spartan
What i understand in this problem is that you must find the MST and the 2nd MST, in a weighted non-directed graph. I'm making a classic Kruskal, then i save in a vector the solution's edges. Finally a loop in that vector deactivating one edge at the time, and choosing the minor MST of that loop. But i'm getting WA in Test 2. I don't know why, i have already check my code over and over again. I think that i am miss-understanding the problem. Anyone could help me?

Re: 1010 - ACM contest and Blackout

Posted: Tue Sep 17, 2013 10:51 am
by ymondelo20
Grettings,
Your idea is fine...
You should have some implementation error.
When you loop for the solution, deactivating edges of the first MST, are you still using all other edges for makig the second MST ?