結果

問題 No.1701 half price
ユーザー ああいいああいい
提出日時 2022-01-10 00:04:55
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 435 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-04-26 19:58:22
合計ジャッジ時間 3,611 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,096 KB
testcase_01 AC 45 ms
59,008 KB
testcase_02 AC 89 ms
69,248 KB
testcase_03 AC 42 ms
59,008 KB
testcase_04 AC 87 ms
69,120 KB
testcase_05 AC 50 ms
61,312 KB
testcase_06 AC 535 ms
75,776 KB
testcase_07 AC 530 ms
75,904 KB
testcase_08 RE -
testcase_09 AC 44 ms
58,752 KB
testcase_10 AC 39 ms
51,712 KB
testcase_11 AC 43 ms
58,880 KB
testcase_12 AC 43 ms
59,008 KB
testcase_13 AC 44 ms
59,008 KB
testcase_14 AC 44 ms
58,880 KB
testcase_15 AC 41 ms
58,752 KB
testcase_16 AC 36 ms
51,712 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 35 ms
51,712 KB
testcase_21 AC 516 ms
75,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,W = map(int,input().split())
a = list(map(int,input().split()))

ans = set()
for bit in range(3 ** N):
    nedan = 0
    b = 0
    for j in range(N):
        if bit % 3 == 0:
            pass
        elif bit % 3 == 1:
            nedan += a[j]
            b ^= (1 << j)
        else:
            nedan += a[j] // 2
            b ^= (1 << j)
        bit //= 3
    if nedan == W:
        ans.add(b)
if W == 0:ans -= 1
print(len(ans))
0