結果

問題 No.2730 Two Types Luggage
ユーザー hato336hato336
提出日時 2024-04-19 21:27:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,040 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 267,432 KB
最終ジャッジ日時 2024-04-19 21:28:02
合計ジャッジ時間 19,726 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
85,248 KB
testcase_01 AC 133 ms
85,504 KB
testcase_02 AC 151 ms
89,600 KB
testcase_03 AC 135 ms
85,588 KB
testcase_04 AC 167 ms
89,984 KB
testcase_05 AC 148 ms
89,984 KB
testcase_06 AC 145 ms
89,856 KB
testcase_07 AC 129 ms
85,504 KB
testcase_08 AC 132 ms
85,504 KB
testcase_09 AC 146 ms
89,600 KB
testcase_10 AC 150 ms
92,672 KB
testcase_11 AC 523 ms
265,724 KB
testcase_12 AC 1,001 ms
261,372 KB
testcase_13 AC 418 ms
206,016 KB
testcase_14 AC 524 ms
261,232 KB
testcase_15 AC 627 ms
136,704 KB
testcase_16 AC 268 ms
137,856 KB
testcase_17 AC 613 ms
258,392 KB
testcase_18 AC 561 ms
267,432 KB
testcase_19 AC 167 ms
104,960 KB
testcase_20 AC 308 ms
167,604 KB
testcase_21 AC 482 ms
252,600 KB
testcase_22 AC 594 ms
260,948 KB
testcase_23 AC 198 ms
107,904 KB
testcase_24 AC 342 ms
180,268 KB
testcase_25 AC 516 ms
261,956 KB
testcase_26 AC 228 ms
136,396 KB
testcase_27 AC 482 ms
251,520 KB
testcase_28 AC 325 ms
179,044 KB
testcase_29 AC 566 ms
267,372 KB
testcase_30 AC 578 ms
108,288 KB
testcase_31 AC 409 ms
203,600 KB
testcase_32 AC 421 ms
211,112 KB
testcase_33 AC 1,009 ms
262,732 KB
testcase_34 AC 1,040 ms
262,604 KB
testcase_35 AC 1,005 ms
262,996 KB
testcase_36 AC 1,009 ms
262,856 KB
testcase_37 AC 1,016 ms
262,436 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