結果
| 問題 |
No.2730 Two Types Luggage
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-19 21:27:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,017 ms / 2,000 ms |
| コード長 | 784 bytes |
| コンパイル時間 | 333 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 267,692 KB |
| 最終ジャッジ日時 | 2024-10-11 13:59:58 |
| 合計ジャッジ時間 | 20,030 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
#n = int(input())
#
#alist = []
#s = input()
n,m,w = map(int,input().split())
alist = list(map(int,input().split()))
blist = list(map(int,input().split()))
clist = list(map(int,input().split()))
ans = 0
alist.sort(reverse=True)
alist = list(itertools.accumulate(alist))
for i in itertools.product([0,1],repeat=m):
temp = 0
we = 0
for j in range(m):
if i[j]:
temp += clist[j]
we += blist[j]
res = w - we
if res >= n:
temp += alist[-1]
elif res >= 1:
temp += alist[res-1]
if we <= w:
ans = max(ans,temp)
print(ans)