結果
問題 | No.37 遊園地のアトラクション |
ユーザー |
![]() |
提出日時 | 2020-12-30 20:25:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 68 ms / 5,000 ms |
コード長 | 281 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 75,648 KB |
最終ジャッジ日時 | 2024-10-10 13:46:50 |
合計ジャッジ時間 | 2,680 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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] * (T + 1)for v, c in zip(V, C):while v:for i in reversed(range(c, T + 1)):dp[i] = max(dp[i], dp[i - c] + v)v //= 2print(dp[T])