結果

問題 No.1701 half price
ユーザー titan23titan23
提出日時 2022-07-03 03:41:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 76,564 KB
最終ジャッジ日時 2023-08-18 23:04:43
合計ジャッジ時間 3,669 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,260 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 67 ms
76,360 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 66 ms
71,208 KB
testcase_10 AC 67 ms
70,920 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 65 ms
71,260 KB
testcase_15 AC 66 ms
71,116 KB
testcase_16 AC 69 ms
70,956 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 61 ms
71,144 KB
testcase_21 AC 84 ms
76,320 KB
権限があれば一括ダウンロードができます

ソースコード

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(n+1):
  B = A[:]
  if i < n:
    B[i] //= 2
  for bits in range(1 << n):
    tmp = 0
    for j in range(n):
      if (bits >> j) & 1:
        tmp += B[j]
    if tmp == w:
      ans.add(bits)
print(len(ans))
0