QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#839. 서브마스크 무시하기

الإحصائيات

$n$개의 정수로 이루어진 배열 $a_1, a_2, \dots, a_n$이 주어집니다. 각 정수는 $0$ 이상 $2^k - 1$ 이하입니다.

$f(x)$를 $(a_i \& x) \neq a_i$를 만족하는 가장 작은 $i$라고 정의합시다. 만약 그러한 $i$가 존재하지 않는다면 $f(x) = 0$입니다. 여기서 $(a \& b)$는 비트 단위 AND 연산입니다.

$f(0) + f(1) + \dots + f(2^k - 1)$을 구하세요. 이 값은 매우 클 수 있으므로 $998\,244\,353$으로 나눈 나머지를 출력하세요.

입력

첫 번째 줄에는 두 정수 $n, k$ ($1 \le n \le 100, 1 \le k \le 60$)가 주어집니다.

두 번째 줄에는 $n$개의 정수 $a_1, a_2, \dots, a_n$ ($0 \le a_i < 2^k$)이 주어집니다.

출력

$f(0) + f(1) + \dots + f(2^k - 1)$을 $998\,244\,353$으로 나눈 나머지를 출력하세요.

예제

입력 1

2 1
0 1

출력 1

2

참고

첫 번째 예제에서 $f(0) = 2, f(1) = 0$입니다.

입력 2

2 2
2 1

출력 2

4

참고

두 번째 예제에서 $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.