結果

問題 No.1701 half price
ユーザー titan23titan23
提出日時 2022-07-03 03:49:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 416 bytes
コンパイル時間 1,308 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 81,376 KB
最終ジャッジ日時 2023-08-18 23:20:15
合計ジャッジ時間 7,568 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,536 KB
testcase_01 AC 86 ms
76,216 KB
testcase_02 AC 650 ms
77,092 KB
testcase_03 AC 83 ms
76,372 KB
testcase_04 AC 656 ms
76,760 KB
testcase_05 AC 85 ms
76,684 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()

#  -----------------------  #

n, w = map(int, input().split())
A = list(map(int, input().split()))
ans = set()
for i in range(1 << n):
  B = A[:]
  for j in range(n):
    if i >> j & 1:
      B[j] //= 2

  for k in range(1 << n):
    tmp = 0
    for j in range(n):
      if k >> j & 1:
        tmp += B[j]
    if tmp == w:
      ans.add(k)

print(len(ans))
0