# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25792 | TAMREF | 앱 (KOI13_app) | C++11 | 3 ms | 2096 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll D[10005];
int C[105], M[105],N,T;
int main(){
scanf("%d%d",&N,&T);
for(int i=0;i<N;i++) scanf("%d",&M[i]);
for(int i=0;i<N;i++) scanf("%d",&C[i]);
for(int i=0;i<N;i++){
for(int c=0;c+C[i]<=1e4;c++){
if(D[c]) D[c+C[i]]=max(D[c+C[i]],D[c]+M[i]);
}
D[C[i]]=max(D[C[i]],(ll)M[i]);
}
for(int c=0;c<=1e4;c++) if(D[c]>=T) return !printf("%d\n",c);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |