# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
1152 | | kriii | 앱 (KOI13_app) | C++98 | | 0 ms | 1128 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 <stdio.h>
int N,M,V[10100];
int m[101],c[101];
int main()
{
int i,j;
for (i=1;i<=10000;i++) V[i] = -1;
scanf ("%d %d",&N,&M);
for (i=0;i<N;i++) scanf ("%d",&m[i]);
for (i=0;i<N;i++) scanf ("%d",&c[i]);
for (i=0;i<N;i++){
for (j=10000;j>=0;j--) if (V[j] != -1){
if (V[j+c[i]] < V[j] + m[i])
V[j+c[i]] = V[j] + m[i];
}
}
for (i=0;i<=10000;i++) if (V[i] >= M) break;
printf ("%d",i);
return 0;
}
# | 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... |