51Nod 1085 背包问题(01)
来源:互联网 发布:mac磁盘管理工具 编辑:程序博客网 时间:2024/06/05 14:19
题目链接
#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>#include<vector>using namespace std;int main(){int n,w;cin>>n>>w;int we[1001],v[1001];for(int i=0;i<n;i++){cin>>we[i]>>v[i];}int f[10001]={0};for(int i=0;i<n;i++){for(int j=w;j>=we[i];j--){f[j]=max(f[j],f[j-we[i]]+v[i]);}}cout<<f[w];return 0;}
阅读全文
1 0
- 51nod 1085 背包问题【01背包】
- 51nod 1085 背包问题【01背包】
- 51nod-1085 背包问题【01背包】
- 51nod 1085 背包问题01
- 51Nod 1085 背包问题(01)
- 51nod 1085 背包问题
- 51nod 1085 背包问题
- 51Nod--1085背包问题
- 51nod 1085 背包问题
- 51Nod 1085 背包问题
- 51Nod 1085 背包问题
- 51nod 1085 背包问题
- 51nod 1085 背包问题
- 【51nod 1085 背包问题】
- 51nod 1085 背包问题
- 51Nod-1085 背包问题
- 51nod--1085--背包问题
- 51nod 1085 背包问题
- QGraphicItem实现中心旋转
- nodejs-新建项目及Error:Connot find module 'jade'或者‘ejs’ .......错误的解决方法
- Meta http-equiv属性详解(转)
- 夜神模拟器使用后Android studio不能再使用源生模拟器
- S
- 51Nod 1085 背包问题(01)
- 为springmvc设置servelet、拦截器(interceptor)、监听器(listener)、过滤器(filter),类型转换器
- Objective-C中获取视频指定帧的方法
- 欢迎使用CSDN-markdown编辑器
- Android消息提示Toast的使用总结
- 真正的软件测试实习2
- 没有动力时可以一看
- <11>——Container With Most Water
- 嵌入式系统开发-5.2