poj3624 01背包裸题
来源:互联网 发布:地图点聚合算法 编辑:程序博客网 时间:2024/06/04 19:14
题目链接:点击打开链接
#include <iostream>#include<cstring>using namespace std;const int maxn=3500;int a[maxn],v[maxn],dp[12900+10];int main(){ int n,m,i,j; while(cin>>n>>m&&n) { for(i=1;i<=n;i++) { cin>>a[i]; cin>>v[i]; } memset(dp,0,sizeof(dp)); for(i=1;i<=n;i++) for(j=m;j>=a[i];j--) dp[j]=max(dp[j],dp[j-a[i]]+v[i]); cout<<dp[m]<<endl; } return 0;}
阅读全文
0 0
- poj3624 01背包裸题
- 【POJ3624】Charm Bracelet 01背包裸题
- POJ3624 Charm Bracelet 01背包裸题
- POJ3624 01背包入门题[DP]
- 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背包
- [七月英语总结]-多一分耐心
- (2) cordova第一个项目 安全问题
- caffe 报错 Check failed: error == cudaSuccess (77 vs. 0) an illegal memory access was encountered
- poj 3087 Shuffle'm Up
- ROC和AUC介绍以及如何计算AUC
- poj3624 01背包裸题
- Hibernate一对多单向关联和双向关联映射方法及其优缺点
- 圆拟合与点云数据球拟合算法
- C++ STL基本容器的使用
- 深度学习核心技术应用与开发
- 【解决】jsPDF之长图片生成PDF(分页,失真)
- intellij idea svn不能更新和提交
- 最短路径问题(Dijkstra)
- try catch +return经典面试题目+总结(以后关于try catch的题全部秒杀)!(一)