Submission #670745

#TimeUsernameProblemLanguageResultExecution timeMemory
670745zzzzzzzzzzzzzzz앱 (KOI13_app)Cpython 3
21 / 21
483 ms3236 KiB
n,m=map(int,input().split()) a=list(map(int,input().split())) #메모리 c=list(map(int,input().split())) #가격 dp=[-999]*10001 dp[0]=0 for i in range(n): for j in range(10000,-1,-1): if(c[i]+j>10000 or dp[j]<0):continue dp[c[i]+j]=max(dp[c[i]+j],dp[j]+a[i]) for i in range(10001): if(dp[i]>=m):print(i);break
#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...