結果
| 問題 |
No.37 遊園地のアトラクション
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-01 10:40:52 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 5,000 ms |
| コード長 | 301 bytes |
| コンパイル時間 | 215 ms |
| コンパイル使用メモリ | 82,468 KB |
| 実行使用メモリ | 65,124 KB |
| 最終ジャッジ日時 | 2024-10-09 22:17:07 |
| 合計ジャッジ時間 | 3,046 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 c,v in zip(C,V):
for i in range(10):
for t in range(T+1)[::-1]:
if c+t <= T:
dp[c+t] = max(dp[c+t],dp[t]+v)
v //= 2
print(dp[-1])