結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 21:41:18 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 2,128 ms |
| コンパイル使用メモリ | 76,800 KB |
| 実行使用メモリ | 75,904 KB |
| 最終ジャッジ日時 | 2024-10-11 14:29:00 |
| 合計ジャッジ時間 | 8,098 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 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)