結果
問題 | No.37 遊園地のアトラクション |
ユーザー |
|
提出日時 | 2021-08-09 14:55:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 980 ms / 5,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-09-21 14:01:21 |
合計ジャッジ時間 | 8,401 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 27 |
ソースコード
T = int(input())N = int(input())C = list(map(int, input().split()))V = list(map(int, input().split()))dp = [0] * 20000for i in range(N):while V[i] > 0:for j in range(T - 1, -1, -1):dp[j + C[i]] = max(dp[j + C[i]], dp[j] + V[i])V[i] = V[i] // 2ans = 0for i in range(T + 1):ans = max(ans, dp[i])print(ans)