結果

問題 No.2730 Two Types Luggage
ユーザー PNJPNJ
提出日時 2024-04-19 23:09:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 807 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 266,960 KB
最終ジャッジ日時 2024-04-19 23:10:10
合計ジャッジ時間 14,045 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,840 KB
testcase_01 AC 37 ms
51,712 KB
testcase_02 AC 44 ms
60,928 KB
testcase_03 AC 33 ms
51,712 KB
testcase_04 AC 55 ms
62,976 KB
testcase_05 AC 42 ms
60,288 KB
testcase_06 AC 42 ms
59,392 KB
testcase_07 AC 39 ms
52,096 KB
testcase_08 AC 35 ms
52,352 KB
testcase_09 AC 47 ms
60,672 KB
testcase_10 AC 46 ms
66,816 KB
testcase_11 AC 358 ms
205,696 KB
testcase_12 AC 799 ms
263,988 KB
testcase_13 AC 278 ms
174,244 KB
testcase_14 AC 386 ms
207,620 KB
testcase_15 AC 430 ms
107,392 KB
testcase_16 AC 157 ms
118,072 KB
testcase_17 AC 430 ms
231,508 KB
testcase_18 AC 392 ms
230,836 KB
testcase_19 AC 63 ms
78,720 KB
testcase_20 AC 167 ms
131,972 KB
testcase_21 AC 331 ms
203,680 KB
testcase_22 AC 472 ms
255,860 KB
testcase_23 AC 93 ms
89,728 KB
testcase_24 AC 197 ms
142,276 KB
testcase_25 AC 342 ms
207,188 KB
testcase_26 AC 121 ms
102,144 KB
testcase_27 AC 352 ms
203,036 KB
testcase_28 AC 185 ms
140,560 KB
testcase_29 AC 422 ms
232,688 KB
testcase_30 AC 410 ms
92,288 KB
testcase_31 AC 303 ms
169,040 KB
testcase_32 AC 253 ms
174,688 KB
testcase_33 AC 756 ms
266,124 KB
testcase_34 AC 761 ms
266,960 KB
testcase_35 AC 807 ms
264,024 KB
testcase_36 AC 800 ms
263,896 KB
testcase_37 AC 758 ms
263,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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.append(0)
A = A[::-1]
for i in range(N):
  A[i+1] += A[i]

ans = A[min(N,W)]

for bit in range(1 << M):
  w,v = 0,0
  for j in range(M):
    if (bit >> j) & 1:
      w += B[j]
      v += C[j]
  if w > W:
    continue
  ans = max(ans,v + A[min(N,W-w)])
print(ans)
0