|
|
back to boardHint! Observe than A[i] must be equal 0 or 1 ( no double ). Just compute dp[v]. dp[v] is cost of traffic of subTree with root v if A[v] = 1. If A[v]=0 than cost(of traffic of subTree with root v) equals zero. Edited by author 03.09.2013 01:58 Edited by author 03.09.2013 01:59 |
|
|