Timus Online Judge
About Online Judge
Frequently asked questions
Update your info
back to board
Discussion of Problem
. Martian Army
3 Sep 2013 01:55
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
Timus Online Judge Team
. All rights reserved.