|
|
вернуться в форумDP O(n^2), why wa on test #9? [code cut out] Edited by moderator 05.08.2004 00:19 Re: DP O(n^2), why wa on test #9? This problem is NP so your DP... There was another one saying it's DP, CO2 I think... People, the Hamiltonian Cycle is NP-Complete I don't know why are you trying to find DPs... Well, in this case, the tests are really stupid so I passed them with back and greedy, but this is not relevant... But in this prob the points are the vertices of a convex polygon, and you can prove that the best path doesn't cross itself. So I think DP is feasible. My AC is also DP O(n^2) (+) Would you please tell me your e-mail so you can point out my mistakes? And I'm curious how you use only O(n) memory. |
|
|