結果

問題 No.2730 Two Types Luggage
ユーザー budoubudou
提出日時 2024-04-20 07:47:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 833 ms / 2,000 ms
コード長 749 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 270,064 KB
最終ジャッジ日時 2024-04-20 07:47:53
合計ジャッジ時間 14,863 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
66,560 KB
testcase_01 AC 61 ms
67,456 KB
testcase_02 AC 65 ms
70,656 KB
testcase_03 AC 54 ms
66,688 KB
testcase_04 AC 85 ms
78,080 KB
testcase_05 AC 61 ms
74,112 KB
testcase_06 AC 57 ms
69,376 KB
testcase_07 AC 59 ms
66,688 KB
testcase_08 AC 55 ms
67,200 KB
testcase_09 AC 62 ms
74,408 KB
testcase_10 AC 65 ms
78,168 KB
testcase_11 AC 381 ms
243,596 KB
testcase_12 AC 785 ms
268,324 KB
testcase_13 AC 332 ms
217,048 KB
testcase_14 AC 365 ms
245,300 KB
testcase_15 AC 465 ms
130,424 KB
testcase_16 AC 184 ms
147,584 KB
testcase_17 AC 487 ms
265,672 KB
testcase_18 AC 416 ms
265,756 KB
testcase_19 AC 96 ms
91,140 KB
testcase_20 AC 209 ms
166,416 KB
testcase_21 AC 357 ms
220,784 KB
testcase_22 AC 460 ms
269,236 KB
testcase_23 AC 123 ms
93,840 KB
testcase_24 AC 246 ms
166,316 KB
testcase_25 AC 385 ms
245,280 KB
testcase_26 AC 142 ms
122,568 KB
testcase_27 AC 345 ms
220,236 KB
testcase_28 AC 221 ms
148,608 KB
testcase_29 AC 426 ms
266,892 KB
testcase_30 AC 427 ms
93,844 KB
testcase_31 AC 309 ms
216,208 KB
testcase_32 AC 307 ms
198,472 KB
testcase_33 AC 831 ms
270,064 KB
testcase_34 AC 820 ms
268,908 KB
testcase_35 AC 804 ms
268,004 KB
testcase_36 AC 833 ms
268,912 KB
testcase_37 AC 804 ms
268,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import typing
import sys
from collections import defaultdict
input = lambda: sys.stdin.readline().strip()
inf = 10**18
mod = 998244353
# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
# sys.setrecursionlimit(10**6)

def solve():
  N, M, W = map(int, input().split())
  A = list(map(int, input().split()))
  A.sort(reverse=True)
  acc = [0]
  for a in A:
    acc.append(a+acc[-1])

  B = list(map(int, input().split()))
  C = list(map(int, input().split()))
  ans = 0
  for s in range(1<<M):
    v = w = 0
    for i in range(M):
      if (s >> i)&1:
        v += C[i]
        w += B[i]
    if w > W:
      continue
    v += acc[min(N, W-w)]
    ans = max(ans, v)
  print(ans)
def main():
  t = 1
  for _ in range(t):
    solve()
main()
0