結果

問題 No.2730 Two Types Luggage
ユーザー hato336hato336
提出日時 2024-04-19 21:27:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 904 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 267,816 KB
最終ジャッジ日時 2024-04-19 21:27:57
合計ジャッジ時間 17,309 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
85,632 KB
testcase_01 AC 111 ms
85,888 KB
testcase_02 AC 125 ms
89,984 KB
testcase_03 AC 119 ms
85,632 KB
testcase_04 AC 147 ms
89,984 KB
testcase_05 AC 129 ms
90,368 KB
testcase_06 AC 124 ms
90,136 KB
testcase_07 AC 116 ms
85,504 KB
testcase_08 AC 119 ms
85,632 KB
testcase_09 AC 131 ms
89,856 KB
testcase_10 AC 131 ms
93,056 KB
testcase_11 AC 435 ms
265,848 KB
testcase_12 AC 877 ms
261,900 KB
testcase_13 AC 354 ms
206,560 KB
testcase_14 AC 442 ms
261,252 KB
testcase_15 AC 578 ms
136,892 KB
testcase_16 AC 236 ms
138,112 KB
testcase_17 AC 499 ms
258,524 KB
testcase_18 AC 481 ms
267,816 KB
testcase_19 AC 152 ms
105,600 KB
testcase_20 AC 267 ms
167,704 KB
testcase_21 AC 405 ms
252,988 KB
testcase_22 AC 506 ms
261,572 KB
testcase_23 AC 180 ms
108,288 KB
testcase_24 AC 326 ms
180,520 KB
testcase_25 AC 435 ms
262,184 KB
testcase_26 AC 203 ms
136,832 KB
testcase_27 AC 410 ms
251,904 KB
testcase_28 AC 284 ms
179,812 KB
testcase_29 AC 479 ms
267,684 KB
testcase_30 AC 533 ms
108,288 KB
testcase_31 AC 357 ms
203,984 KB
testcase_32 AC 345 ms
211,524 KB
testcase_33 AC 873 ms
262,948 KB
testcase_34 AC 886 ms
262,992 KB
testcase_35 AC 879 ms
263,192 KB
testcase_36 AC 904 ms
263,116 KB
testcase_37 AC 882 ms
262,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0