|
|
back to boardTo admins 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 (-) |
|
|