結果
| 問題 | No.37 遊園地のアトラクション |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-13 22:56:28 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 37 ms / 5,000 ms |
| + 142µs | |
| コード長 | 347 bytes |
| 記録 | |
| コンパイル時間 | 78 ms |
| コンパイル使用メモリ | 81,280 KB |
| 実行使用メモリ | 64,256 KB |
| 最終ジャッジ日時 | 2026-09-13 06:00:02 |
| 合計ジャッジ時間 | 2,889 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
T = int(input())
n = int(input())
c = list(map(int, input().split()))
v = list(map(int, input().split()))
f = [0] * (T + 1)
for i in range(n):
g = [x for x in f]
total, need = 0, 0
while v[i]:
total += v[i]
need += c[i]
v[i] >>= 1
for j in range(need, T + 1):
g[j] = max(g[j], f[j - need] + total)
f = g
print(max(f))