Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

DP三种状态及其意义

Posted by uuuouou at 2014-08-25 16:09:58 on Problem 3659
/*
f[i] stands for subtree with root being i
f[i][0] stands for tower needed to cover the whole tree using i
f[i][1] stands for tower needed to cover the whole tree wihout using i
f[i][2] stands for tower needed to cover the tree except i
then we have:
f[r][2] = sum{f[c][1]}, where c is child of r <= cover all subtrees without using subtree root
f[r][0] = 1 + sum{min(f[c][0], f[c][1], f[c][2])}
f[r][1] = choose one child k use f[k][0], then sum up other children min(f[i][0], f[i][1])
*/

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator