|  | 
|  | 
| вернуться в форум | Can anyone help me? I couldn't solove this problem.Thanks Послано abc  6 мар 2005 07:55thanks!!!!!!!Re: Can anyone help me? I couldn't solove this problem.Thanks Послано OneV1  30 апр 2005 02:59i 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 Послано Hayk  4 ноя 2006 19:14Thank you!You helped me.
 | 
 | 
|