結果
| 問題 |
No.37 遊園地のアトラクション
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2020-12-08 09:06:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 5,000 ms |
| コード長 | 258 bytes |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 62,592 KB |
| 最終ジャッジ日時 | 2024-10-10 13:46:47 |
| 合計ジャッジ時間 | 2,960 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
t = int(input())
n = int(input())
*c, = map(int,input().split())
*v, = map(int,input().split())
dp = [0]*(1+t)
for ci,vi in zip(c,v):
while vi:
for i in range(t,ci-1,-1):
dp[i] = max(dp[i], dp[i-ci]+vi)
vi //= 2
print(max(dp))
convexineq