Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
46507 Jerry 最大价值 C++ Accepted 0 MS 248 KB 210 2024-05-04 10:44:46

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


Judgement Protocol: