| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 67319 | cly | 开心的金明 | C++ | Accepted | 100 | 0 MS | 452 KB | 295 | 2023-01-12 16:17:58 |
#include<bits/stdc++.h> using namespace std; const int N=30010; int n,m; int f[N]; int main(){ cin>>m>>n; for (int i=1;i<=n;i++){ int v,w; cin>>v>>w; for(int j=m;j>=v;j--) f[j]=max(f[j],f[j-v]+w*v); } cout<<f[m]; return 0; }