結果

問題 No.1701 half price
ユーザー Kiri8128Kiri8128
提出日時 2021-10-08 22:00:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 76,932 KB
最終ジャッジ日時 2023-09-30 10:07:49
合計ジャッジ時間 4,417 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,248 KB
testcase_01 AC 72 ms
71,072 KB
testcase_02 AC 101 ms
76,216 KB
testcase_03 AC 72 ms
71,232 KB
testcase_04 AC 96 ms
76,248 KB
testcase_05 AC 81 ms
75,936 KB
testcase_06 AC 420 ms
76,632 KB
testcase_07 AC 326 ms
76,932 KB
testcase_08 WA -
testcase_09 AC 75 ms
75,952 KB
testcase_10 AC 63 ms
71,024 KB
testcase_11 AC 74 ms
71,040 KB
testcase_12 AC 67 ms
71,336 KB
testcase_13 AC 76 ms
70,880 KB
testcase_14 AC 73 ms
71,188 KB
testcase_15 AC 80 ms
75,752 KB
testcase_16 AC 75 ms
71,052 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 75 ms
70,952 KB
testcase_21 AC 412 ms
76,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, W = map(int, input().split())
A = [int(a) for a in input().split()]
ans = 0
for i in range(1 << N):
    j = i + 1
    while j:
        j = (j - 1) & i
        s = 0
        for k in range(N):
            if j >> k & 1:
                s += A[k] // 2
            elif i >> k & 1:
                s += A[k]
        if s == W:
            ans += 1
            break
print(ans)
0