QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 512 MB Puntuación total: 100

#839. 部分マスクの無視

Estadísticas

$n$ 個の整数からなる配列 $a_1, a_2, \dots, a_n$ が与えられます。各整数は $0$ 以上 $2^k - 1$ 以下です。

$f(x)$ を、$(a_i \& x) \neq a_i$ を満たす最小の $i$ と定義します。そのような $i$ が存在しない場合は $0$ とします。ここで $(a \& b)$ はビットごとの AND 演算を表します。

$f(0) + f(1) + \dots + f(2^k - 1)$ を求めてください。この値は非常に大きくなる可能性があるため、$998\,244\,353$ で割った余りを出力してください。

入力

入力は以下の形式で与えられます。

$n$ $k$ $a_1$ $a_2$ $\dots$ $a_n$

$1 \le n \le 100$、$1 \le k \le 60$、$0 \le a_i < 2^k$ です。

出力

$f(0) + f(1) + \dots + f(2^k - 1)$ を $998\,244\,353$ で割った余りを 1 つの整数として出力してください。

入出力例

入力 1

2 1
0 1

出力 1

2

注記

最初の例では、$f(0) = 2, f(1) = 0$ です。

入力 2

2 2
2 1

出力 2

4

注記

2 番目の例では、$f(0) = 1, f(1) = 1, f(2) = 2, f(3) = 0$ です。

入力 3

5 10
389 144 883 761 556

出力 3

1118

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.