QOJ.ac

QOJ

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

#839. Ignorar Submáscaras

Estadísticas

Se te da un arreglo de $n$ enteros, $a_1, a_2, \dots, a_n$. Cada entero está entre $0$ y $2^k - 1$, inclusive.

Definamos $f(x)$ como el índice $i$ más pequeño tal que $(a_i \& x) \neq a_i$, o $0$ si no existe tal $i$. $(a \& b)$ es la operación AND a nivel de bits.

Calcula $f(0) + f(1) + \dots + f(2^k - 1)$. Como este valor puede ser muy grande, calcúlalo módulo $998\,244\,353$.

Entrada

La primera línea contiene dos enteros: $n, k$ ($1 \le n \le 100$, $1 \le k \le 60$).

La siguiente línea contiene $n$ enteros: $a_1, a_2, \dots, a_n$ ($0 \le a_i < 2^k$).

Salida

Imprime un entero: $f(0) + f(1) + \dots + f(2^k - 1)$, módulo $998\,244\,353$.

Ejemplos

Entrada 1

2 1
0 1

Salida 1

2

Entrada 2

2 2
2 1

Salida 2

4

Entrada 3

5 10
389 144 883 761 556

Salida 3

1118

Nota

En el primer ejemplo, $f(0) = 2, f(1) = 0$.

En el segundo ejemplo, $f(0) = 1, f(1) = 1, f(2) = 2, f(3) = 0$.

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.