|
|
вернуться в форумI am getting TLE on test 24. How will you choose from which town to start? Because of this I had to start from every town to find the answer. For each town it took me O(n),so for all the towns it becomes O(n^2), causing TLE. Actually that's the main issue for this problem. If you want a hint - that's it: try to develop some dynamic programming scheme for solution. Edited by author 05.04.2013 16:20 Edited by author 05.04.2013 16:20 Finally AC! Slight implementation change got me AC!. Edited by author 05.04.2013 16:19 Edited by author 05.04.2013 16:19 |
|
|