結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,968 KB
testcase_01 AC 44 ms
58,752 KB
testcase_02 AC 89 ms
69,248 KB
testcase_03 AC 45 ms
58,752 KB
testcase_04 AC 86 ms
69,248 KB
testcase_05 AC 50 ms
61,312 KB
testcase_06 AC 536 ms
75,648 KB
testcase_07 AC 535 ms
75,648 KB
testcase_08 WA -
testcase_09 AC 44 ms
58,752 KB
testcase_10 AC 38 ms
51,840 KB
testcase_11 AC 44 ms
59,008 KB
testcase_12 AC 43 ms
59,008 KB
testcase_13 AC 43 ms
59,264 KB
testcase_14 AC 44 ms
58,624 KB
testcase_15 AC 44 ms
58,496 KB
testcase_16 AC 37 ms
52,096 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 38 ms
51,712 KB
testcase_21 AC 525 ms
75,776 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