# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20231 | kgy5809 | 앱 (KOI13_app) | C11 | 2 ms | 0 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 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 (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... |