結果
| 問題 | No.2730 Two Types Luggage |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 21:54:22 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 614 ms / 2,000 ms |
| + 159µs | |
| コード長 | 510 bytes |
| 記録 | |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 64,256 KB |
| 実行使用メモリ | 205,396 KB |
| 最終ジャッジ日時 | 2026-11-05 00:34:20 |
| 合計ジャッジ時間 | 16,488 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
from itertools import accumulate, product
N, M, W = map(int,input().split())
A = sorted(map(int,input().split()), reverse=True)
B = list(map(int,input().split()))
C = list(map(int,input().split()))
BC = [[b, c] for b, c in zip(B, C)]
acc = [0] + list(accumulate(A))
ans = 0
for bit in product([0, 1], repeat=M):
w = 0; p = 0
for i in range(M):
if bit[i]:
w += BC[i][0]
p += BC[i][1]
if w > W:
continue
ans = max(ans, p + acc[min(N, W-w)])
print(ans)