結果

問題 No.2730 Two Types Luggage
コンテスト
ユーザー ryohei22
提出日時 2024-05-03 21:51:11
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 441 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 62 ms
コンパイル使用メモリ 82,716 KB
実行使用メモリ 291,952 KB
最終ジャッジ日時 2026-09-29 14:55:53
合計ジャッジ時間 16,782 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 13 WA * 7 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, M, W = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(2**M):
	lst = []
	for j in range(M):
		if (i >> j) & 1:
			lst.append(j)
	w = sum(B[i] for i in lst)
	v = sum(C[i] for i in lst)
	if W < w:
		continue

	j = 0
	while j < N and w + A[j] <= W:
		w += 1
		v += A[j]
		j += 1
	ans = max(ans, v)
print(ans)
0