結果

問題 No.1701 half price
ユーザー KudeKude
提出日時 2021-10-08 22:00:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 86,112 KB
実行使用メモリ 76,500 KB
最終ジャッジ日時 2023-09-30 10:08:24
合計ジャッジ時間 3,290 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,724 KB
testcase_01 AC 76 ms
70,872 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 83 ms
75,792 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 78 ms
70,644 KB
testcase_10 AC 77 ms
70,732 KB
testcase_11 WA -
testcase_12 AC 77 ms
70,732 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 78 ms
70,796 KB
testcase_16 AC 78 ms
70,760 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 77 ms
70,652 KB
testcase_21 AC 103 ms
76,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, w = map(int, input().split())

ans = 0
def solve(a, w):
    global ans
    n = len(a)
    for s in range(1 << n):
        x = 0
        for i in range(n):
            if s >> i & 1:
                x += a[i]
        ans += x == w

a = list(map(int, input().split()))
solve(a, w)
for i in range(n):
    solve(a[:i] + a[i + 1:], w - a[i] // 2)

print(ans)
0