# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20231 | 2016-05-17T17:47:15 Z | kgy5809 | 앱 (KOI13_app) | C | 2 ms | 0 KB |
#include <stdio.h> int m[100], c[100]; int N, M; void main() { int i, j, t; int dp[10000] = { 0 }; scanf("%d%d", &N, &M); for (i = 0; i<N; scanf("%d", m + i++)); for (i = 0; i<N; scanf("%d", c + i++)); for (t = i = 0; i<N; i++)t += c[i]; for (i = 0; i<N; i++) { for (j = t; j >= c[i]; j--) { if (dp[j]<dp[j - c[i]] + m[i]) { dp[j] = dp[j - c[i]] + m[i]; } } } for (i = 0; i <= t; i++) { if (dp[i] >= M)break; } printf("%d", i); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 0 KB | Execution failed because the return code was nonzero |