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 1227. Rally Championship

To admins
Posted by Loky_Yuri [USTU] 12 Jul 2007 18:08
Rather simple tests…
For this test my AC program gives “NO”:
4 2 13
1 2 15
3 4 10
But the correct answer is YES.
So as I understood, in all your tests, if graph is unconnected and there is no cycle in it, then the max length of path always contain the last (m) vertex…
So all programs which use this algorithm passed all your tests:
First, check knots, multigraph;
Second, for (I, 1, n) - check is the i vertex is in the circle;
Third, find the max length of path of that tree, which contain the last vertex; and compare it with s.
INSTEAD: Third, find the max length of paths ALL TREES, and all of them compare with s.

Sorry for my English.
Thanks. Test was added (-)
Posted by Sandro (USU) 13 Jul 2007 01:45