結果

問題 No.1701 half price
ユーザー ああいいああいい
提出日時 2022-01-10 00:01:00
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 872 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 77,240 KB
最終ジャッジ日時 2023-08-09 04:59:50
合計ジャッジ時間 5,513 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,136 KB
testcase_01 AC 76 ms
76,340 KB
testcase_02 AC 112 ms
76,656 KB
testcase_03 AC 77 ms
76,492 KB
testcase_04 AC 115 ms
76,628 KB
testcase_05 AC 80 ms
76,328 KB
testcase_06 AC 569 ms
77,044 KB
testcase_07 AC 566 ms
76,888 KB
testcase_08 WA -
testcase_09 AC 74 ms
76,448 KB
testcase_10 AC 69 ms
71,104 KB
testcase_11 AC 74 ms
76,388 KB
testcase_12 AC 75 ms
76,572 KB
testcase_13 AC 73 ms
76,288 KB
testcase_14 AC 73 ms
76,368 KB
testcase_15 AC 76 ms
76,356 KB
testcase_16 AC 72 ms
71,340 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 68 ms
71,380 KB
testcase_21 AC 546 ms
77,020 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)
print(len(ans))
0