Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46516 jiabokai 最大价值 C++ 通过 0 MS 256 KB 211 2024-05-04 10:47:13

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int t,m,a[605]; int main(){ cin>>t>>m; for(int T,p;cin>>T>>p;){ for(int j=t;j>=T;j--){ a[j]=max(a[j],a[j-T]+p); } } cout<<a[t]; return 0; }


测评信息: