結果

問題 No.1701 half price
ユーザー 👑 KazunKazun
提出日時 2021-10-08 21:59:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 86,060 KB
実行使用メモリ 76,664 KB
最終ジャッジ日時 2023-09-30 10:04:30
合計ジャッジ時間 5,040 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
70,712 KB
testcase_01 AC 89 ms
75,728 KB
testcase_02 AC 129 ms
76,136 KB
testcase_03 AC 85 ms
75,800 KB
testcase_04 AC 125 ms
75,880 KB
testcase_05 AC 87 ms
75,796 KB
testcase_06 AC 568 ms
76,380 KB
testcase_07 AC 569 ms
76,188 KB
testcase_08 WA -
testcase_09 AC 82 ms
75,852 KB
testcase_10 AC 77 ms
70,732 KB
testcase_11 AC 84 ms
75,804 KB
testcase_12 AC 86 ms
76,108 KB
testcase_13 AC 85 ms
75,772 KB
testcase_14 AC 86 ms
75,800 KB
testcase_15 AC 84 ms
76,056 KB
testcase_16 AC 79 ms
70,912 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 80 ms
70,828 KB
testcase_21 AC 559 ms
76,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

S=set()

for T in range(3**N):
    alpha=0
    beta=0

    for i in range(N):
        if T%3==0:
            alpha+=A[i]
            beta+=1<<i
        elif T%3==1:
            alpha+=A[i]//2
            beta+=1<<i

        T//=3

    if alpha==W:
        S.add(beta)

print(len(S))
0