Submission #670744

#TimeUsernameProblemLanguageResultExecution timeMemory
670744zzzzzzzzzzzzzzz앱 (KOI13_app)Cpython 3
0 / 21
948 ms3300 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(10001): 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...