結果

問題 No.1701 half price
ユーザー titan23titan23
提出日時 2022-07-03 04:21:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 1,548 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 78,480 KB
最終ジャッジ日時 2023-08-19 00:08:54
合計ジャッジ時間 6,199 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,104 KB
testcase_01 AC 86 ms
76,488 KB
testcase_02 AC 162 ms
77,340 KB
testcase_03 AC 82 ms
76,364 KB
testcase_04 AC 156 ms
77,040 KB
testcase_05 AC 91 ms
76,524 KB
testcase_06 AC 833 ms
76,844 KB
testcase_07 AC 834 ms
77,132 KB
testcase_08 WA -
testcase_09 AC 80 ms
76,052 KB
testcase_10 AC 74 ms
71,440 KB
testcase_11 AC 80 ms
76,132 KB
testcase_12 AC 83 ms
76,304 KB
testcase_13 AC 79 ms
76,392 KB
testcase_14 AC 78 ms
76,512 KB
testcase_15 AC 79 ms
76,424 KB
testcase_16 AC 75 ms
71,196 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 74 ms
71,428 KB
testcase_21 AC 858 ms
76,956 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(3**n):
  tmp = 0
  buy = set()
  for j in range(n):
    if i%3 == 0:
      tmp += A[j]
      buy.add(j)
    elif i % 3 == 1:
      tmp += A[j] // 2
      buy.add(j)
    i //= 3

  if tmp == w:
    ans.add(frozenset(buy))

print(len(ans))
0