Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46510 sunhuifeng 最大价值 C++ 解答错误 0 MS 244 KB 206 2024-05-04 10:45:05

Tests(0/1):


#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; }


测评信息: