1010 - ACM contest and Blackout

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Post Reply
User avatar
dovier
Posts: 1143
Joined: 8 years ago
Location: Havana, Cuba
Gender: Male
Cuba

1010 - ACM contest and Blackout

Post by dovier » 8 years ago




Spartan
Posts: 11
Joined: 8 years ago
Gender: Male
Cuba

Re: 1010 - ACM contest and Blackout

Post by Spartan » 6 years ago

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?

User avatar
ymondelo20
Posts: 1968
Joined: 8 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1010 - ACM contest and Blackout

Post by ymondelo20 » 6 years ago

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 ?
"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

Post Reply

Return to “Problem set”