issues
search
SamZhangQingChuan
/
Editorials
算法题解& 教程
283
stars
26
forks
source link
树上依赖背包问题
#12
Open
ongiant
opened
1 year ago
ongiant
commented
1 year ago
在给的
树上背包pdf文件
里第
5
节
算法
里, $dp
r=I
{C_r,W
r} * (\mathbf 1 + dp
{s
1}) * (\mathbf 1 + dp
{s
2})
\dots$,为何 $*$ 的时候要加 $\mathbf 1$,而不是直接 $
dp
{s_1}$
这个泛化物品的解法,状态定义是什么
大佬能把源代码传到github上来吗?我等
hdu
已经半个月了,还是宕机状态,实在等不下去了
SamZhangQingChuan
commented
1 year ago
因为dp定义里面要求“一定要拿根对应的物品”,不加1就表示一定要拿儿子对应的物品
第5节第一段
https://github.com/SamZhangQingChuan/Editorials/blob/master/%E6%95%99%E7%A8%8B/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92/%E6%A0%91%E4%B8%8A%E8%83%8C%E5%8C%85/src/main.tex
源代码里面有
5
节算法
里, $dpr=I{C_r,Wr} * (\mathbf 1 + dp{s1}) * (\mathbf 1 + dp{s2}) \dots$,为何 $*$ 的时候要加 $\mathbf 1$,而不是直接 $ dp{s_1}$hdu
已经半个月了,还是宕机状态,实在等不下去了