Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46510 | sunhuifeng | 最大价值 | C++ | Wrong Answer | 0 MS | 244 KB | 206 | 2024-05-04 10:45:05 |
#include<iostream> using namespace std; int t,m,a[605]; int main(){ cin>>t>>m; for(int t1,p;cin>>t1,p;){ for(int j=t;j>=t1;j--){ a[j]=max(a[j],a[j-t1]+p); } } cout<<a[t]; return 0; }