結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 21:41:35 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 889 ms / 2,000 ms |
| コード長 | 487 bytes |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 268,624 KB |
| 最終ジャッジ日時 | 2024-10-11 14:30:17 |
| 合計ジャッジ時間 | 15,330 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
n, m, w = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
sa = [0]
for ai in a:
sa.append(sa[-1] + ai)
ans = 0
for i in range(1 << m):
weight, value = 0, 0
for j in range(m):
if i & (1 << j):
weight += b[j]
value += c[j]
if weight > w:
continue
value += sa[min(w - weight, n)]
ans = max(ans, value)
print(ans)