Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
47071 ☩Deutschland☩ 最大价值 C++ 通过 0 MS 248 KB 212 2024-05-12 10:31:21

Tests(1/1):


#include<bits/stdc++.h> 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; }


测评信息: