結果

問題 No.2730 Two Types Luggage
コンテスト
ユーザー rarpipipi
提出日時 2024-04-20 08:55:35
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 556 ms / 2,000 ms
+ 511µs
コード長 458 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 64,896 KB
実行使用メモリ 212,692 KB
最終ジャッジ日時 2026-10-16 00:35:24
合計ジャッジ時間 14,849 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import accumulate
n,m,w=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
acc=[0]+list(accumulate(a))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=acc[min(n,w)]

for i in range(1,1<<m):
    sum_w=0
    v=0
    for j in range(m):
        if i>>j&1==1:
            sum_w+=b[j]
            v+=c[j]

    if sum_w>w:
        continue
    v+=acc[min((w-sum_w),n)]
    ans=max(ans,v)

print(ans)
0