結果

問題 No.1701 half price
ユーザー tobusakanatobusakana
提出日時 2022-12-03 13:38:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 81,280 KB
最終ジャッジ日時 2024-04-18 22:40:57
合計ジャッジ時間 6,312 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
57,472 KB
testcase_01 AC 44 ms
59,364 KB
testcase_02 AC 51 ms
62,720 KB
testcase_03 AC 43 ms
59,392 KB
testcase_04 AC 63 ms
68,864 KB
testcase_05 AC 43 ms
51,840 KB
testcase_06 AC 57 ms
64,000 KB
testcase_07 AC 270 ms
75,648 KB
testcase_08 WA -
testcase_09 AC 39 ms
51,840 KB
testcase_10 AC 37 ms
51,456 KB
testcase_11 AC 42 ms
51,840 KB
testcase_12 AC 47 ms
59,136 KB
testcase_13 AC 46 ms
58,880 KB
testcase_14 AC 51 ms
60,288 KB
testcase_15 AC 50 ms
59,904 KB
testcase_16 AC 39 ms
51,968 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 42 ms
51,968 KB
testcase_21 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
for status in range(1 << N):
    val = 0
    for i in range(N):
        if (status >> i) & 1:
            val += A[i] // 2
    if val > W:
        continue
    for bits in range(1 << N):
        temp = val
        for i in range(N):
            if (status >> i) & 1 == 0 or (bits >> i) & 1 == 0:
                continue
            temp += A[i] // 2
        if temp == W:
            ans += 1
            break

print(ans)
0