|
|
вернуться в форумAnd what about this test? Послано Sandro 31 янв 2005 15:42 My AC solution with DP outputs 2 in this test: 6 0 3 1 0 2 2 3 5 4 1 5 4 But the correct answer is 3. Maybe this test should be added to the test set. My output is 3, so your DP is rather strange :) (-) Re: My output is 3, so your DP is rather strange :) (-) Послано Sandro 31 янв 2005 22:03 I think so :) Re: How did you solve it? Послано Sandro 3 фев 2005 11:27 I remember the optimal answer for sets of ties with numbers k..l for all k,l (for all segments). The optimal answer Ans(k,l+1)= max(Ans(k,l),S+1), where S is the sum of optimal answers for all segments in k..l, that any tie of any of these segments doesn't intersect (l+1)th tie. (In the first case we delete (l+1)th tie, in the second case leave (l+1) and delete all ties, intersecting it.) This algorith is not correct, because ties in the optimal solutions can intersect, so sum of the optimal solutions may not be solution at all. My test is the simple example of it. But this algorith gets AC, and this is very strange. |
|
|