SamZhangQingChuan / Editorials

算法题解& 教程
283 stars 26 forks source link

树上依赖背包问题 #12

Open ongiant opened 1 year ago

ongiant commented 1 year ago
  1. 在给的树上背包pdf文件里第5算法里, $dpr=I{C_r,Wr} * (\mathbf 1 + dp{s1}) * (\mathbf 1 + dp{s2}) \dots$,为何 $*$ 的时候要加 $\mathbf 1$,而不是直接 $ dp{s_1}$
  2. 这个泛化物品的解法,状态定义是什么
  3. 大佬能把源代码传到github上来吗?我等hdu已经半个月了,还是宕机状态,实在等不下去了
SamZhangQingChuan commented 1 year ago
  1. 因为dp定义里面要求“一定要拿根对应的物品”,不加1就表示一定要拿儿子对应的物品
  2. 第5节第一段
  3. 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 源代码里面有