
背包问题
Phoebe201421085
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj1276
#include #include #include using namespace std; int main() { freopen("in.txt","r",stdin); int cash; bool a[100010]; while (cin>>cash) { memset(a,0,siz原创 2015-03-20 19:14:19 · 379 阅读 · 0 评论 -
背包之01背包、完全背包、多重背包详解
首先我们把三种情况放在一起来看: 01背包(ZeroOnePack): 有N件物品和一个容量为V的背包。(每种物品均只有一件)第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使价值总和最大。 完全背包(CompletePack): 有N种物品和一个容量为V的背包,每种物品都有无限件可用。第i种物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的转载 2015-03-20 19:15:54 · 572 阅读 · 0 评论