結果

問題 No.1701 half price
ユーザー tnodinotnodino
提出日時 2022-05-24 21:26:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 81,692 KB
実行使用メモリ 75,560 KB
最終ジャッジ日時 2023-10-20 18:56:10
合計ジャッジ時間 3,357 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,400 KB
testcase_01 AC 43 ms
59,892 KB
testcase_02 AC 80 ms
70,352 KB
testcase_03 AC 41 ms
59,960 KB
testcase_04 AC 74 ms
70,352 KB
testcase_05 AC 44 ms
62,160 KB
testcase_06 AC 487 ms
75,360 KB
testcase_07 AC 478 ms
75,440 KB
testcase_08 WA -
testcase_09 AC 42 ms
59,892 KB
testcase_10 AC 37 ms
53,400 KB
testcase_11 AC 42 ms
59,892 KB
testcase_12 AC 42 ms
59,892 KB
testcase_13 AC 42 ms
59,892 KB
testcase_14 AC 42 ms
59,892 KB
testcase_15 AC 41 ms
59,888 KB
testcase_16 AC 37 ms
53,400 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 35 ms
53,400 KB
testcase_21 AC 472 ms
75,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,W = map(int,input().split())
a = list(map(int,input().split()))
ans = set()
for bit in range(3**N):
    ret = 0
    x = bit
    b = 0
    for i in range(N):
        if x % 3 == 0:
            pass
        else:
            if x % 3 == 2:
                ret += a[i] // 2
            elif x % 3 == 1:
                ret += a[i]
            b += 1
        x //= 3
        b <<= 1
    if ret == W:
        ans.add(b)
print(len(ans))
0