卬高杯
提出id | 提出時刻 | ユーザー名 | 問題 | 言語 | 判定状況 | 判定 | 実行時間 |
---|---|---|---|---|---|---|---|
114756 | 2023-10-24 07:41:58 | nouka28 | G | python | 16/16 | AC | 966 |
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
dp=[0]*m
for i in range(n):
for j in range(m-1,-1,-1):
if j+y[i]<m:dp[j+y[i]]=max(dp[j+y[i]],dp[j]+x[i])
print(max(dp))
sample1.txt AC 15 case1.txt AC 19 case2.txt AC 966 case3.txt AC 16 case4.txt AC 60 case5.txt AC 88 case6.txt AC 104 case7.txt AC 170 case8.txt AC 99 case9.txt AC 45 case10.txt AC 158 case11.txt AC 38 case12.txt AC 41 case13.txt AC 87 case14.txt AC 110 case15.txt AC 17 966 AC