poj 3624 裸的01背包
来源:互联网 发布:php curl模拟post提交 编辑:程序博客网 时间:2024/06/12 00:01
背包九讲 这里写的真是太详细了。。。
压力大啊。。不得不学DP了。。。
#include<stdio.h>#include<string.h>int v[13000];int w[3500];int c[3500];int n,m;int max(int a,int b){return a>b?a:b;}int main(){while(scanf("%d%d",&n,&m)!=EOF){for(int i=1;i<=n;i++){scanf("%d%d",&c[i],&w[i]);}memset(v,0,sizeof(v));for(int i=1;i<=n;i++){for(int j=m;j>=c[i];j--){v[j]=max(v[j],v[j-c[i]]+w[i]);}}printf("%d\n",v[m]);}return 0;}
- poj 3624 裸的01背包
- 01 背包 poj 3624
- poj 3624 01背包
- poj 3624 01 背包
- poj 3624 01背包
- poj 3624 01背包
- POJ 3624 01背包
- POJ-3624 01背包
- poj 3624(01背包)
- poj 3624 01背包
- POJ-3624-01背包
- POJ 3624 Charm Bracelet【裸01背包和关于贪心解 01 背包问题的思考】
- 01背包问题 poj 3624
- POJ 3624 01背包问题
- poj 3624 dp-01背包
- POJ 3624 还是01背包
- poj 3624 01背包 水
- POJ 3624 01背包(DP)
- 随笔
- JAVA :Jpanel 控件 无法显示问题
- c#时间获取和表示格式
- Android 底层按键获取
- HttpClient和HttpResponse的使用
- poj 3624 裸的01背包
- Web基础之Javascript 进阶
- 调用函数求阶乘。
- android应用基础
- 更改iTunes的设备备份路径
- UVa 10591 - Happy Number
- Struts2.3.4 、Hibernate3.6 和Spring3.1.2整合所需jar包列表
- bmp图像 蓝桥杯
- linux下设置固定IP的方法