1048: 采药2
来源:互联网 发布:网络词丑陋的欧洲人 编辑:程序博客网 时间:2024/05/22 07:00
点击打开链接http://sdnuacm.sinaapp.com/problem.php?id=1048
#include<iostream>#include<cstdio>using namespace std;int main(){int m,n,w,v;int max=0;int f[1005]={0};scanf("%d%d",&m,&n);for(int i=1;i<=n;i++){scanf("%d%d",&w,&v);for(int j=w;j<=m;j++){if(f[j]<f[j-w]+v)f[j]=f[j-w]+v;}}printf("%d",f[m]);return 0;}
- 1048: 采药2
- 采药2
- 采药-洛谷 1048
- 采药2 (Standard IO)
- jzoj2540 采药2
- 采药2(转载)
- 01背包 采药2
- 采药
- 采药
- 采药
- 采药
- 采药
- 采药!
- 采药
- 采药
- 采药
- 采药
- 采药
- Entity Framework 全面教程详解(转)
- [Leetcode] Longest Common Prefix
- 在for...Loops中使用hasOwnProperty()方法
- 阿里云 ubuntu 安装 JDK
- jprofiler安装和配置
- 1048: 采药2
- static和const的比较和解释
- 【配置关系】—Entity Framework实例详解
- Asp.Net MVC3 简单教程(一)环境准备
- Apache 中 .htaccess 文件设置技巧16则
- 虚拟机中ubuntu设置静态IP的方法
- Asp.Net MVC3 简单教程(二)详解Asp.Net MVC3项目
- asp.net动态引用WebService
- eclipse与hadoop