結果

問題 No.1701 half price
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-10-08 22:08:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 689 ms / 3,000 ms
コード長 457 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 78,104 KB
最終ジャッジ日時 2023-09-30 10:22:57
合計ジャッジ時間 5,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,492 KB
testcase_01 AC 79 ms
76,476 KB
testcase_02 AC 136 ms
77,284 KB
testcase_03 AC 79 ms
76,584 KB
testcase_04 AC 136 ms
77,116 KB
testcase_05 AC 84 ms
76,664 KB
testcase_06 AC 683 ms
77,172 KB
testcase_07 AC 689 ms
77,288 KB
testcase_08 AC 74 ms
71,336 KB
testcase_09 AC 79 ms
76,312 KB
testcase_10 AC 75 ms
71,396 KB
testcase_11 AC 80 ms
76,360 KB
testcase_12 AC 79 ms
76,304 KB
testcase_13 AC 78 ms
76,324 KB
testcase_14 AC 79 ms
76,688 KB
testcase_15 AC 78 ms
76,424 KB
testcase_16 AC 73 ms
71,460 KB
testcase_17 AC 346 ms
78,104 KB
testcase_18 AC 89 ms
76,864 KB
testcase_19 AC 91 ms
76,764 KB
testcase_20 AC 74 ms
71,184 KB
testcase_21 AC 689 ms
76,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

"""
from sys import stdin
import sys

N,W = map(int,stdin.readline().split())

a = list(map(int,stdin.readline().split()))

ans = set()
for i in range(3**N):

    now = 0
    s = []
    for j in range(N):
        if i % 3 == 0:
            now += a[j]
        elif i % 3 == 1:
            now += a[j] // 2
        else:
            s.append(j)
        i //= 3

    s.sort()
    if now == W and len(s) != N:
        ans.add(tuple(s))

print (len(ans))
0