文件名称:rootdp
-
所属分类:
- 标签属性:
- 上传时间:2012-12-28
-
文件大小:4.01kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
题意:a->b c :攻克b城堡前要先攻克a城堡攻克b城堡将获得c
共有n个城堡(编号为-n)最多攻克m个城堡能获得的最大收益
把作为树的根把节点连成一棵树
p[root][i]表示在以root为根的子树中选取i个点能获得的最大收益
p[root][i]=max(p[root][i],p[root][i-j]+p[v[e]][j])
当root!=0时每棵子树根必选所以p[root][i]=p[root][i-1]+val[root]
结果为p[0][m]
-Meaning of the questions: a-> bc: overcome b Castle before the first capture of a castle overcome b Castle will get c
The total n Castle (number-n) up to overcome the m castles can get maximum benefit
The root of the tree as a node connected into a tree
p [root] [i] i points to get selected in the sub-tree root-root maximum benefit
p [root] [i] = max (p [root] [i], p [root] [ij]+ p [v [e]] [j])
When the root! = 0 Meike subtree root Required so p [root] [i] = p [root] [i-1]+ val [root]
The result is p [0] [m]
共有n个城堡(编号为-n)最多攻克m个城堡能获得的最大收益
把作为树的根把节点连成一棵树
p[root][i]表示在以root为根的子树中选取i个点能获得的最大收益
p[root][i]=max(p[root][i],p[root][i-j]+p[v[e]][j])
当root!=0时每棵子树根必选所以p[root][i]=p[root][i-1]+val[root]
结果为p[0][m]
-Meaning of the questions: a-> bc: overcome b Castle before the first capture of a castle overcome b Castle will get c
The total n Castle (number-n) up to overcome the m castles can get maximum benefit
The root of the tree as a node connected into a tree
p [root] [i] i points to get selected in the sub-tree root-root maximum benefit
p [root] [i] = max (p [root] [i], p [root] [ij]+ p [v [e]] [j])
When the root! = 0 Meike subtree root Required so p [root] [i] = p [root] [i-1]+ val [root]
The result is p [0] [m]
(系统自动生成,下载前可以参看下载内容)
下载文件列表
hdu1561树形DP.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.