結果

問題 No.1701 half price
ユーザー neko_the_shadowneko_the_shadow
提出日時 2021-10-10 01:18:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 77,524 KB
最終ジャッジ日時 2023-10-11 17:00:27
合計ジャッジ時間 4,760 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,312 KB
testcase_01 AC 77 ms
76,220 KB
testcase_02 AC 115 ms
76,420 KB
testcase_03 AC 82 ms
76,220 KB
testcase_04 AC 116 ms
76,276 KB
testcase_05 AC 80 ms
76,300 KB
testcase_06 AC 538 ms
76,816 KB
testcase_07 AC 538 ms
77,148 KB
testcase_08 WA -
testcase_09 AC 78 ms
76,032 KB
testcase_10 AC 72 ms
71,216 KB
testcase_11 AC 77 ms
76,036 KB
testcase_12 AC 76 ms
76,140 KB
testcase_13 AC 80 ms
76,392 KB
testcase_14 AC 79 ms
76,164 KB
testcase_15 AC 80 ms
75,932 KB
testcase_16 AC 75 ms
71,244 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 74 ms
71,200 KB
testcase_21 AC 522 ms
76,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, w = map(int, input().split())
a = list(map(int, input().split()))

ans = set()
for bit in range(3**n):
    x = bit
    total = 0
    key = 0
    for i in range(n):
        y = x % 3
        x //= 3
        if y == 1: total += a[i]
        if y == 2: total += a[i] // 2
        if y != 0: key |= (1 << i)
    if total == w: ans.add(key)

print(len(ans))
0