秋祭 | 静岡高校工学部



卬高杯


提出詳細

提出id提出時刻ユーザー名問題言語判定状況判定実行時間
1147562023-10-24 07:41:58nouka28Gpython16/16AC966

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