ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1416. Confidential

Is something wrong with sample #1? Need answer ASAP.
Posted by tedomir 26 May 2010 22:17
4 6
1 2 2
2 3 2
3 4 2
4 1 2
1 3 1
2 4 1
Cost: 4
Cost: 4
1:
why not 1>4(cost 2, minimum. Description says if transition between A > B is possible then B > A is possible too)
That gives answer: 2
2:1>3(cost 1) then 3>4(cost 2), 1+2=3
That gives answer: 3

Anyone mind explaining why its 4 and 4 in sample?
Re: Is something wrong with sample #1? Need answer ASAP.
Posted by Sandro (USU) 27 May 2010 00:10
"choose the minimal possible set of trans-planet passages so that he could pass from any planet to any other one via those passages"

If you choose 1-3 and 3-4, you can't reach planet 2 from the other planets.