結果

問題 No.1701 half price
ユーザー tktk_snsntktk_snsn
提出日時 2021-10-08 22:01:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 76,908 KB
最終ジャッジ日時 2023-09-30 10:10:13
合計ジャッジ時間 4,845 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,480 KB
testcase_01 AC 81 ms
76,212 KB
testcase_02 AC 124 ms
76,552 KB
testcase_03 AC 80 ms
76,496 KB
testcase_04 AC 120 ms
76,216 KB
testcase_05 AC 85 ms
76,268 KB
testcase_06 AC 599 ms
76,772 KB
testcase_07 AC 587 ms
76,908 KB
testcase_08 WA -
testcase_09 AC 81 ms
76,288 KB
testcase_10 AC 76 ms
71,288 KB
testcase_11 AC 80 ms
76,024 KB
testcase_12 AC 80 ms
76,284 KB
testcase_13 AC 80 ms
76,256 KB
testcase_14 AC 80 ms
76,280 KB
testcase_15 AC 79 ms
76,256 KB
testcase_16 AC 76 ms
71,484 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 75 ms
71,380 KB
testcase_21 AC 588 ms
76,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, W = map(int, input().split())
A = list(map(int, input().split()))

ans = set()
for S in range(3 ** N):
    tot = 0
    buy = 0
    for i, a in enumerate(A):
        if S % 3 == 0:
            tot += a
            buy |= (1 << i)
        elif S % 3 == 1:
            tot += a // 2
            buy |= (1 << i)
        S //= 3
    if W == tot:
        ans.add(buy)

print(len(ans))
0