# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
18282 | | mindol | 앱 (KOI13_app) | C++98 | | 1 ms | 5028 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<cstdio>
#include<algorithm>
using namespace std;
int dt[101][10001]; // dt[i][j] : A1~Ai 까지의 앱 중에서 볼 때 비용 j를 써서 얻을 수 있는 최대 메모리
int m[101],c[101];
int main()
{
int N,M,totc=0;
scanf("%d %d",&N,&M);
for(int i=1;i<=N;i++)
scanf("%d",&m[i]);
for(int i=1;i<=N;i++)
scanf("%d",&c[i]),totc+=c[i];
for(int i=1;i<=N;i++)
for(int j=c[i];j<=totc;j++)
dt[i][j]=max(dt[i-1][j],dt[i-1][j-c[i]]+m[i]);
for(int i=0;i<=totc;i++)
for(int j=1;j<=N;j++)
if(dt[j][i]>=M)
{
printf("%d",i);
return 0;
}
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... |