結果
問題 | No.1701 half price |
ユーザー | wgrape |
提出日時 | 2024-11-11 11:08:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 408 ms / 3,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 576 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 61,952 KB |
最終ジャッジ日時 | 2024-11-11 11:08:54 |
合計ジャッジ時間 | 3,838 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
N,W = map(int,input().split()) A = list(map(int,input().split())) ans = set() for status in range(1, 3 ** N): i = 0 val = 0 cond = 0 while status: if status % 3 == 2: val += A[i] cond |= (1 << i) elif status % 3 == 1: val += A[i] // 2 cond |= (1 << i) status //= 3 i += 1 if val == W: ans.add(cond) print(len(ans))