poj 3624 01背包
来源:互联网 发布:巫师3和老滚5 知乎 编辑:程序博客网 时间:2024/06/05 20:28
#include<cstdio>#include<cstring>#define MAX(x,y) ((x)>(y)?(x):(y))long long dp[12888];int v[3480],w[3480];int main(){int n,col;scanf("%d%d",&n,&col);for(int i=1;i<=n;i++)scanf("%d%d",&w[i],&v[i]);memset(dp,0,sizeof(dp));for(int i=1;i<=n;i++){for(int j=col;j>=w[i];j--){dp[j]=MAX(dp[j],dp[j-w[i]]+v[i]);}}printf("%lld\n",dp[col]);}
0 0
- 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背包
- 01背包问题 poj 3624
- POJ 3624 01背包问题
- poj 3624 dp-01背包
- POJ 3624 还是01背包
- poj 3624 01背包 水
- POJ 3624 01背包(DP)
- 【POJ 3624】 + 01背包 + dp
- POJ 3628 Bookshelf2 / POJ 3624 Charm Bracelet / POJ 1384 初涉01背包与完全背包
- Activity跳转切换动画
- 算法导论(problems 6-3 Young tableaus)
- 策略模式+工厂模式优化if...else if...else if结构
- Spring 3之MVC & Security简单整合开发(一)
- C#中DataSet类的使用
- poj 3624 01背包
- IIS 访问网站 错误消息 401.3
- APP切换语言
- android 软键盘显示与隐藏
- js断点调试心得
- Xtrabackup怎么工作的
- ios 属性
- 图解反转单向链表
- JDK1.8的几大新特性