ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1039. Anniversary Party

Can anyone help me? I couldn't solove this problem.Thanks
Posted by abc 6 Mar 2005 07:55
thanks!!!!!!!
Re: Can anyone help me? I couldn't solove this problem.Thanks
Posted by OneV1 30 Apr 2005 02:59
i used Dynamic Programming in DFS.

a[i] = best only for the subtree with the root in "i" ; "i" is going to the party.
b[i] = best only for the subtree with the root in "i" ; "i" is not going to the party.

a[i] = v[i] + sum of all b[j], (i is the boss of j)
b[i] = sum of all MAX(a[j], b[j])  (i is the boss of j)
Re: Can anyone help me? I couldn't solove this problem.Thanks
Posted by Hayk 4 Nov 2006 19:14
Thank you!
You helped me.