AtCoder Regular Contest 198 (Div. 2)
E
Monotone OR
AtCoder
⌀ 2988
原题
← D→
翻译中…

Problem Statement

翻译中…

You are given a set $S = \lbrace s_1,s_2,\dots,s_M \rbrace$ of non-negative integers between $0$ and $2^N - 1$ (inclusive).

翻译中…

You start with a non-negative integer $x = 0$. Find the number, modulo $998244353$, of ways to reach $x = 2^N$ by performing the following operation any number of times:

翻译中…
  • Choose an integer $i$ with $1 \le i \le M$, and replace $x$ with $(x\ \mathrm{OR}\ s_i) + 1$.
翻译中…

Here, $\mathrm{OR}$ denotes the bitwise logical OR.

翻译中…

Constraints

翻译中…
  • $1 \le N \le 24$
  • $1 \le M \le \min(2^N,2 \times 10^{5})$
  • $0 \le s_1 < s_2 < \dots < s_M < 2^N$
翻译中…

Input

翻译中…

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

翻译中…

N M
s_1\ s_2\ \dots\ s_M

翻译中…

Output

翻译中…

Output the number of ways, modulo $998244353$.

翻译中…

样例

Input #1
2 2
1 2
Output #1
5
Let $(i, k)$ denote the transition when an operation chooses $i$ and results in $x = k$. There are five ways that satisfy the conditions: - $(1,2) \rightarrow (1,4)$ - $(1,2) \rightarrow (2,3) \rightarrow (1,4)$ - $(1,2) \rightarrow (2,3) \rightarrow (2,4)$ - $(2,3) \rightarrow (1,4)$ - $(2,3) \rightarrow (2,4)$ Even if the sequence of values of $x$ is identical, ways that differ in the choices of $i$ are counted separately.
Input #2
5 10
3 5 8 9 11 16 17 23 27 28
Output #2
242816764
Input #3
24 32
673802 709603 941436 987977 1288854 1448514 1890649 2031791 2194398 3531579 3540682 4352378 4676427 5094869 5243789 6064976 6412917 7164733 8403938 9123034 10396333 10558625 10726446 12263566 12421464 12503511 12676340 14032527 14268967 14669703 15823827 16285412
Output #3
508425421
题目信息
题号
arc198_e
时间限制
7 s
内存限制
1024 MB

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