結果
問題 |
No.2730 Two Types Luggage
|
ユーザー |
|
提出日時 | 2024-08-13 14:06:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,950 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 395 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 268,496 KB |
最終ジャッジ日時 | 2024-08-13 14:06:50 |
合計ジャッジ時間 | 23,996 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
from itertools import accumulate N, M, W = map(int, input().split()) A = list(accumulate(sorted(map(int, input().split()), reverse=True), initial=0)) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = 0 for S in range(1<<M): wgt = sum(b for i, b in enumerate(B) if S>>i&1) if wgt > W: continue val = sum(c for i, c in enumerate(C) if S>>i&1) ans = max(ans, val + A[min(W - wgt, N)]) print(ans)