Submission #1152

#TimeUsernameProblemLanguageResultExecution timeMemory
1152kriii앱 (KOI13_app)C++98
21 / 21
0 ms1128 KiB
#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 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...