why my code works?

Revision en1, by p_321052, 2022-05-30 01:22:37

this problem : https://codeforces.me/contest/1369/problem/D

my code : https://codeforces.me/contest/1369/submission/158768076

dp[i][j] = maximum number of yellow nodes of tree of level i. if j = 0, it's root is not colored. otherwise it's root is colored.

well, it seems reasonable but since it returns maximum value modulo 1e9+7, we can't tell which value is actually bigger one.

but my code passed. why does it work? or is it because of weak test data?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English p_321052 2022-05-30 01:22:37 494 Initial revision (published)