結果

問題 No.2730 Two Types Luggage
ユーザー flygonflygon
提出日時 2024-04-19 21:29:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 815 ms / 2,000 ms
コード長 685 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 271,248 KB
最終ジャッジ日時 2024-04-19 21:29:25
合計ジャッジ時間 13,975 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
54,144 KB
testcase_01 AC 37 ms
54,656 KB
testcase_02 AC 45 ms
63,232 KB
testcase_03 AC 38 ms
54,656 KB
testcase_04 AC 58 ms
65,280 KB
testcase_05 AC 49 ms
62,592 KB
testcase_06 AC 46 ms
62,080 KB
testcase_07 AC 40 ms
54,400 KB
testcase_08 AC 38 ms
54,656 KB
testcase_09 AC 54 ms
63,488 KB
testcase_10 AC 54 ms
71,296 KB
testcase_11 AC 349 ms
252,892 KB
testcase_12 AC 753 ms
267,912 KB
testcase_13 AC 292 ms
212,824 KB
testcase_14 AC 370 ms
271,248 KB
testcase_15 AC 480 ms
116,384 KB
testcase_16 AC 166 ms
140,892 KB
testcase_17 AC 418 ms
264,168 KB
testcase_18 AC 396 ms
260,484 KB
testcase_19 AC 72 ms
87,040 KB
testcase_20 AC 180 ms
160,156 KB
testcase_21 AC 345 ms
251,168 KB
testcase_22 AC 444 ms
268,600 KB
testcase_23 AC 99 ms
95,616 KB
testcase_24 AC 225 ms
173,984 KB
testcase_25 AC 371 ms
254,572 KB
testcase_26 AC 134 ms
117,756 KB
testcase_27 AC 342 ms
250,128 KB
testcase_28 AC 205 ms
168,524 KB
testcase_29 AC 402 ms
258,552 KB
testcase_30 AC 393 ms
95,360 KB
testcase_31 AC 295 ms
208,312 KB
testcase_32 AC 271 ms
194,116 KB
testcase_33 AC 755 ms
269,672 KB
testcase_34 AC 788 ms
270,884 KB
testcase_35 AC 770 ms
270,320 KB
testcase_36 AC 815 ms
270,176 KB
testcase_37 AC 758 ms
269,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,m,w = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
a = a[::-1]
cnt = [0]
for i in range(n):
    cnt.append(cnt[-1] + a[i])

ans = 0
for bit in range(1<<m):
    ws = 0
    vs = 0
    for i in range(m):
        if (bit>>i) & 1:
            ws += b[i]
            vs += c[i]
        
    if ws <= w:
        ans = max(ans, vs+cnt[min(len(cnt)-1,w-ws)])
    
print(ans)
0