摘要: 01 背包 题意: 在N件物品取出若干件放在容量为W的背包里,每件物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够容纳的最大价值。 f[i][v] = max{ f[i-1][v] , f[i-1][ v-c[i] ] + w[i] } # 阅读全文
posted @ 2017-07-24 10:05 Draymonder 阅读(211) 评论(0) 推荐(0)