can someone help me correcting my code?

Revision en1, by p_321052, 2022-07-12 10:22:18

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?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English p_321052 2022-07-12 10:22:18 471 Initial revision (published)