01背包-poj3624
来源:互联网 发布:mysql 视图 union all 编辑:程序博客网 时间:2024/06/17 14:21
纯01背包,没有任何转化。
#include<iostream>#include<algorithm>using namespace std;int w[5000],v[5000];int f[15000];int main(){ int n,m; //while(cin>>n>>m) //{ cin>>n>>m; for(int i=1;i<=n;i++) { cin>>w[i]>>v[i]; f[i]=0; } for(int i=1;i<=n;i++) for(int j=m;j>=w[i];j--) f[j]=max(f[j],f[j-w[i]]+v[i]); cout<<f[m]<<endl; //} return 0;}
- poj3624--01背包
- POJ3624 01背包
- poj3624 dp 01背包
- 1poj3624(01背包)
- poj3624--01背包
- poj3624(01背包)
- 01背包-poj3624
- poj3624 01背包
- POJ3624(01背包问题)
- 01背包poj3624
- poj3624 01背包
- POJ3624 01背包问题
- POJ3624 01背包
- POJ3624--01背包
- poj3624 01背包
- poj3624 01背包
- POJ3624 01背包
- POJ3624——01背包
- error in invoking target 'mkldflags ntcontab.o nnfgt.o' of makefile
- C++ STL入门教程(1)——vector(向量容器)的使用(附完整程序代码)
- Android Tween和Frame 动画
- myeclipse中集成aptana插件
- COM 组件设计与应用----起源及复合文件
- 01背包-poj3624
- poj 2516 Minimum Cost(最小费用最大流)
- 截取指定长度
- 重温面向对象——单一功能原则
- POJ-1273-Drainage Ditches
- 一个c++中计算算法运行时间的程序
- IIS音频格式了解
- hdu 1394 Minimum Inversion Number
- 一个Python中的闭包问题