結果
| 問題 |
No.1701 half price
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-07 02:04:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 418 bytes |
| コンパイル時間 | 159 ms |
| コンパイル使用メモリ | 82,400 KB |
| 実行使用メモリ | 76,252 KB |
| 最終ジャッジ日時 | 2024-07-21 13:45:50 |
| 合計ジャッジ時間 | 3,060 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 4 |
ソースコード
N, W = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(1 << N):
C = []
res = 0
add = 0
for j in range(N):
if i & 1 << j:
res += a[j]
C.append(j)
if res == W:
add = 1
L = len(C)
for j in range(1 << L):
res2 = res
for k in range(L):
if j & 1 << k:
res2 -= a[C[k]] // 2
if res2 == W:
add = 1
ans += add
print(ans)