i'm solving this problem : https://codeforces.me/contest/1280/problem/D and my code : https://codeforces.me/contest/1280/submission/163753815
i thought this is just tree knapsack dp but for some reason, get's wrong answer for test3
dp[i][j] means (maximum number of winning region, maximum advantage of component involving i) when partitioning subtree of i into j regions
can someone tell me what's wrong with my code?
Take a look at Ticket 15647 from CF Stress for a counter example.
this site is amazing thank you!