結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 22:09:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 938 ms / 2,000 ms |
| コード長 | 333 bytes |
| コンパイル時間 | 394 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 270,832 KB |
| 最終ジャッジ日時 | 2024-10-11 15:26:57 |
| 合計ジャッジ時間 | 17,428 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
n,m,w=map(int,input().split())
*a,=map(int,input().split())
*b,=map(int,input().split())
*c,=map(int,input().split())
ar=[0]
for i in sorted(a)[::-1]:
ar+=ar[-1]+i,
ans=0
for i in range(1<<m):
v=0
t=0
for j in range(m):
if i>>j&1:
v+=c[j]
t+=b[j]
if t<=w:
v+=ar[min(w-t,n)]
ans=max(ans,v)
print(ans)