結果
| 問題 |
No.1701 half price
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-08 22:12:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 385 bytes |
| コンパイル時間 | 404 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 76,416 KB |
| 最終ジャッジ日時 | 2024-07-23 04:36:53 |
| 合計ジャッジ時間 | 2,603 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 4 |
ソースコード
n, w = map(int, input().split()) a = list(map(int, input().split())) ans = 0 for b in range(1 << n): cnt = 0 l = [] for i in range(n): if b >> i & 1: cnt += a[i] l.append(a[i]) f = False if cnt == w: f = True for b2 in range(1 << len(l)): cnt2 = cnt for i in range(len(l)): if b2 >> i & 1: cnt2 -= l[i] // 2 if cnt2 == w: f = True; break ans += f print(ans)