Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
DP三种状态及其意义/* 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator