結果

問題 No.1701 half price
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-10-08 22:08:31
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 470 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,548 KB
実行使用メモリ 77,020 KB
最終ジャッジ日時 2023-09-30 10:22:45
合計ジャッジ時間 8,908 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,456 KB
testcase_01 AC 85 ms
76,100 KB
testcase_02 AC 289 ms
76,672 KB
testcase_03 AC 86 ms
76,220 KB
testcase_04 AC 337 ms
77,020 KB
testcase_05 AC 88 ms
76,168 KB
testcase_06 AC 2,847 ms
76,904 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,w = map(int,input().split())
A = list(map(int,input().split()))
ans = set()

for i in range(1<<n):
    nA = []
    for j in range(n):
        if i >> j & 1:
            nA.append(A[j]//2)
        else:
            nA.append(A[j])
    for j in range(1<<n):
        count = 0
        for k in range(n):
            if j >> k & 1:
                count += nA[k]
            if count > w:
                break
        if count == w:
            ans.add(j)
print(len(ans))
0