poj 3624 01 背包
来源:互联网 发布:大学生当程序员 编辑:程序博客网 时间:2024/05/16 11:01
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int dp[13000], v[4000], jz[4000];int n, m;void onetwopack(int v, int c){ for(int i = m; i >= v; i--) dp[i] = max(dp[i], dp[i-v]+c);}int main(){ while(cin >> n >> m) { for(int i = 0; i < n; i++) cin >> v[i] >> jz[i]; memset(dp, 0, sizeof(dp)); for(int i = 0; i < n; i++) onetwopack(v[i], jz[i]); printf("%d\n", dp[m]); }}
- 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背包与完全背包
- 取得电池电量
- Android绘图
- 金字塔
- 视频信号的分类和基本概念
- HDU 4723 How Long Do You Have to Draw 解题报告
- poj 3624 01 背包
- 声音服务
- 面试二
- 在webx.ml中 配置struts2 后 welcome-file-list 失效的解决办法
- Blocks Programming Topics
- 银行数据库笔试编程题
- 关于协方差矩阵和相关系数矩阵的一些应用认识
- Java学习总结之数据类型转换
- C# 实训day1