AtCoder Beginner Contest 367
G
Sum of (XOR^K or 0)
AtCoder
⌀ 3110
原题
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$, $M$, $K$, and a sequence of non-negative integers: $A=(A_1,A_2,\ldots,A_N)$.

翻译中…

For a non-empty non-negative integer sequence $B=(B_1,B_2,\ldots,B_{|B|})$, we define its score as follows.

翻译中…
  • If the length of $B$ is a multiple of $M$: $(B_1 \oplus B_2 \oplus \dots \oplus B_{|B|})^K$
  • Otherwise: $0$
翻译中…

Here, $\oplus$ represents the bitwise XOR.

翻译中…

Find the sum, modulo $998244353$, of the scores of the $2^N-1$ non-empty subsequences of $A$.

翻译中…

What is bitwise XOR? The bitwise XOR of non-negative integers $A$ and $B$, denoted as $A \oplus B$, is defined as follows: In the binary representation of $A \oplus B$, the digit at position $2^k$ ($k \geq 0$) is $1$ if exactly one of $A$ and $B$ has a $1$ in that position in their binary representations, and $0$ otherwise. For example, $3 \oplus 5 = 6$ (in binary: $011 \oplus 101 = 110$). In general, the XOR of $k$ integers $p_1, \dots, p_k$ is defined as $(\cdots ((p_1 \oplus p_2) \oplus p_3) \oplus \cdots \oplus p_k)$, and it can be proved that this is independent of the order of $p_1, \dots, p_k$.

翻译中…

Constraints

翻译中…
  • $1 \leq N,K \leq 2 \times 10^5$
  • $1 \leq M \leq 100$
  • $0 \leq A_i < 2^{20}$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N M K
A_1 A_2 \ldots A_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
3 2 2
1 2 3
Output #1
14
Here are the scores of the $2^3-1=7$ non-empty subsequences of $A$. - $(1)$: $0$ - $(2)$: $0$ - $(3)$: $0$ - $(1,2)$: $(1\oplus2)^2=9$ - $(1,3)$: $(1\oplus3)^2=4$ - $(2,3)$: $(2\oplus3)^2=1$ - $(1,2,3)$: $0$ Therefore, the sought sum is $0+0+0+9+4+1+0=14$.
Input #2
10 5 3
100 100 100 100 100 100 100 100 100 100
Output #2
252000000
Input #3
16 4 100
7053 3876 3178 8422 7802 5998 2334 6757 6889 6637 7365 9495 7848 9026 7312 6558
Output #3
432440016
题目信息
题号
abc367_g
时间限制
3 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。