結果

問題 No.2730 Two Types Luggage
ユーザー moon17moon17
提出日時 2024-04-19 22:09:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 915 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 270,560 KB
最終ジャッジ日時 2024-04-19 22:10:05
合計ジャッジ時間 16,408 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,840 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 51 ms
60,928 KB
testcase_03 AC 39 ms
52,096 KB
testcase_04 AC 68 ms
62,464 KB
testcase_05 AC 50 ms
59,904 KB
testcase_06 AC 46 ms
59,392 KB
testcase_07 AC 38 ms
52,096 KB
testcase_08 AC 39 ms
51,968 KB
testcase_09 AC 55 ms
60,288 KB
testcase_10 AC 60 ms
69,760 KB
testcase_11 AC 480 ms
254,204 KB
testcase_12 AC 862 ms
270,028 KB
testcase_13 AC 404 ms
234,688 KB
testcase_14 AC 451 ms
256,372 KB
testcase_15 AC 475 ms
124,728 KB
testcase_16 AC 196 ms
146,760 KB
testcase_17 AC 494 ms
259,300 KB
testcase_18 AC 463 ms
259,268 KB
testcase_19 AC 80 ms
88,492 KB
testcase_20 AC 252 ms
168,780 KB
testcase_21 AC 449 ms
241,612 KB
testcase_22 AC 547 ms
268,684 KB
testcase_23 AC 115 ms
99,968 KB
testcase_24 AC 252 ms
167,516 KB
testcase_25 AC 467 ms
258,992 KB
testcase_26 AC 152 ms
121,608 KB
testcase_27 AC 436 ms
240,192 KB
testcase_28 AC 261 ms
178,144 KB
testcase_29 AC 481 ms
254,340 KB
testcase_30 AC 429 ms
100,352 KB
testcase_31 AC 382 ms
229,212 KB
testcase_32 AC 335 ms
205,004 KB
testcase_33 AC 904 ms
269,804 KB
testcase_34 AC 894 ms
270,300 KB
testcase_35 AC 915 ms
270,316 KB
testcase_36 AC 894 ms
270,560 KB
testcase_37 AC 912 ms
269,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,w=map(int,input().split())
*a,=map(int,input().split())
*b,=map(int,input().split())
*c,=map(int,input().split())
ar=[0]
for i in sorted(a)[::-1]:
  ar+=ar[-1]+i,
ans=0
for i in range(1<<m):
  v=0
  t=0
  for j in range(m):
    if i>>j&1:
      v+=c[j]
      t+=b[j]
  if t<=w:
    v+=ar[min(w-t,n)]
    ans=max(ans,v)
print(ans)
0