Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46513 sunhuifeng 最大价值 C++ 通过 0 MS 252 KB 207 2024-05-04 10:46:02

Tests(1/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; }


测评信息: