結果
| 問題 |
No.1701 half price
|
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-10-08 22:11:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 454 bytes |
| コンパイル時間 | 373 ms |
| コンパイル使用メモリ | 82,348 KB |
| 実行使用メモリ | 76,248 KB |
| 最終ジャッジ日時 | 2024-07-23 04:34:55 |
| 合計ジャッジ時間 | 3,836 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 4 |
ソースコード
n, w = map(int, input().split())
A =list(map(int, input().split()))
ans = 0
import itertools
used = set()
for p in itertools.product(range(3), repeat=n):
s = 0
t = 0
for j in range(n):
if p[j] == 0:
continue
elif p[j] == 1:
s += A[j]
t |= (1<<j)
else:
s += A[j]//2
t |= (1<<j)
if s == w and t not in used:
ans += 1
used.add(t)
print(ans)
brthyyjp