시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4 초 | 512 MB | 11 | 6 | 5 | 50.000% |
You are given an array $a_1, a_2, \ldots, a_n$ of $n$ nonnegative integers. For each $k$ from $1$ to $n$, find the number of subsequences of size $k$ ($a_{i_1}, a_{i_2}, \ldots, a_{i_k}$; $1 \le i_1 < \ldots < i_k \le n$) such that their bitwise AND is equal to zero ($a_{i_1} \wedge a_{i_2} \wedge \ldots \wedge a_{i_k} = 0$). Since the answers can be very large, compute them modulo $998\,244\,353$.
Two subsequences are considered distinct if there is an index $i$ such that the element $a_i$ is included in one of the subsequences but not the other.
The first line contains an integer $n$ ($1 \le n \le 2^{19}$). The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \le a_i < 2^{19}$).
Print $n$ space-separated integers $b_1, b_2, \ldots, b_n$, where $b_i$ is the answer for $k = i$ modulo $998\,244\,353$.
3 0 1 2
1 3 1
6 1 2 2 7 6 7
0 3 9 10 5 1