Comments
On hollowtwo pointers, 10 years ago
0

This case worked with me output 1,5 2,4 3,3 4,2 5,1

I think you mean this case which failed with me

5 6 1 2 3 4 5 1 2 3 5 5

0

it couldn't be solve with recursive method use only one loop and check at the end for the maximum value here is my solution http://codeforces.me/contest/580/submission/22301569

On zxqflCanada Cup Editorial, 10 years ago
-10

can u explian why this values are optimal!!!!!

I understand your explanation but is this property of weighted tree?! Or it what the problem need?!