結果

問題 No.1701 half price
ユーザー ああいいああいい
提出日時 2022-01-10 00:04:55
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 435 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 80,672 KB
最終ジャッジ日時 2023-08-09 05:00:01
合計ジャッジ時間 5,068 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,188 KB
testcase_01 AC 75 ms
76,244 KB
testcase_02 AC 121 ms
76,580 KB
testcase_03 AC 76 ms
76,552 KB
testcase_04 AC 113 ms
76,768 KB
testcase_05 AC 78 ms
76,276 KB
testcase_06 AC 550 ms
76,864 KB
testcase_07 AC 547 ms
77,216 KB
testcase_08 RE -
testcase_09 AC 72 ms
76,428 KB
testcase_10 AC 68 ms
71,520 KB
testcase_11 AC 74 ms
76,296 KB
testcase_12 AC 72 ms
76,448 KB
testcase_13 AC 71 ms
76,232 KB
testcase_14 AC 73 ms
76,240 KB
testcase_15 AC 74 ms
76,232 KB
testcase_16 AC 68 ms
71,452 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 67 ms
71,224 KB
testcase_21 AC 538 ms
76,992 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