Submission #48949

#TimeUsernameProblemLanguageResultExecution timeMemory
48949leehosu01앱 (KOI13_app)C++17
21 / 21
18 ms1116 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll C[10001],M,N; int main() { ios::sync_with_stdio(0); cin.tie(0); cin>>N>>M; vector<ll>m(N); for(auto&I:m)cin>>I; ll a; int mi=10001; for(auto&I:m) { cin>>a; for(int i=mi-1;i>=a;--i) { if((C[i]=max(C[i],C[i-a]+I))>=M) mi=i; } } printf("%d",mi); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...