卬高杯
提出id | 提出時刻 | ユーザー名 | 問題 | 言語 | 判定状況 | 判定 | 実行時間 |
---|---|---|---|---|---|---|---|
114981 | 2023-10-25 08:36:19 | loop0919 | G | python | 16/16 | AC | 1446 |
N, M = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
dp = [[0 for _ in range(M+1)] for _ in range(N+1)]
for i in range(N):
for j in range(M):
dp[i+1][j] = dp[i][j]
if j >= Y[i]:
dp[i+1][j] = max(dp[i+1][j], dp[i][j-Y[i]] + X[i])
print(max(dp[N]))
sample1.txt AC 16 case1.txt AC 25 case2.txt AC 1446 case3.txt AC 16 case4.txt AC 89 case5.txt AC 174 case6.txt AC 203 case7.txt AC 346 case8.txt AC 181 case9.txt AC 82 case10.txt AC 340 case11.txt AC 62 case12.txt AC 66 case13.txt AC 178 case14.txt AC 219 case15.txt AC 18 1446 AC