結果

問題 No.2730 Two Types Luggage
ユーザー 👑 KA37RIKA37RI
提出日時 2024-04-19 21:54:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 989 ms / 2,000 ms
コード長 603 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 242,096 KB
最終ジャッジ日時 2024-04-19 21:54:57
合計ジャッジ時間 15,800 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
52,096 KB
testcase_01 AC 45 ms
52,096 KB
testcase_02 AC 55 ms
58,880 KB
testcase_03 AC 45 ms
52,224 KB
testcase_04 AC 95 ms
75,264 KB
testcase_05 AC 60 ms
66,048 KB
testcase_06 AC 60 ms
58,624 KB
testcase_07 AC 50 ms
52,224 KB
testcase_08 AC 45 ms
51,584 KB
testcase_09 AC 58 ms
61,824 KB
testcase_10 AC 61 ms
66,944 KB
testcase_11 AC 427 ms
190,124 KB
testcase_12 AC 567 ms
235,580 KB
testcase_13 AC 331 ms
173,660 KB
testcase_14 AC 409 ms
191,040 KB
testcase_15 AC 205 ms
97,024 KB
testcase_16 AC 189 ms
117,600 KB
testcase_17 AC 477 ms
230,444 KB
testcase_18 AC 458 ms
230,632 KB
testcase_19 AC 79 ms
79,872 KB
testcase_20 AC 214 ms
131,568 KB
testcase_21 AC 401 ms
198,620 KB
testcase_22 AC 501 ms
242,096 KB
testcase_23 AC 118 ms
89,728 KB
testcase_24 AC 263 ms
154,612 KB
testcase_25 AC 417 ms
189,576 KB
testcase_26 AC 141 ms
96,128 KB
testcase_27 AC 385 ms
198,092 KB
testcase_28 AC 225 ms
139,644 KB
testcase_29 AC 456 ms
232,064 KB
testcase_30 AC 518 ms
89,088 KB
testcase_31 AC 329 ms
168,196 KB
testcase_32 AC 290 ms
146,644 KB
testcase_33 AC 844 ms
237,572 KB
testcase_34 AC 909 ms
238,328 KB
testcase_35 AC 989 ms
235,780 KB
testcase_36 AC 881 ms
235,776 KB
testcase_37 AC 815 ms
229,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

def main():
  n, m, w = [int(x) for x in input().split()]
  a = [int(x) for x in input().split()]
  b = [int(x) for x in input().split()]
  c = [int(x) for x in input().split()]
  a.sort(reverse=True)
  ac = list(itertools.accumulate(a))
  ac.insert(0, 0)
  bc = [[bc_i, (0, 0)] for bc_i in zip(b, c)]
  ans = 0

  for ch in itertools.product(*bc):
    cap = 0
    val = 0
    for bi, ci in ch:
      cap += bi
      val += ci
      if cap > w:
        break
    if cap <= w:
      val += ac[min(n, w - cap)]
      ans = max(ans, val)

  print(ans)

if __name__ == "__main__":
  main()
0