QOJ.ac

QOJ

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

#839. Bỏ qua các Submask

الإحصائيات

Bạn được cho một mảng gồm $n$ số nguyên $a_1, a_2, \dots, a_n$. Mỗi số nguyên nằm trong khoảng từ $0$ đến $2^k - 1$ (bao gồm cả hai đầu).

Gọi $f(x)$ là chỉ số $i$ nhỏ nhất sao cho $(a_i \& x) \neq a_i$, hoặc bằng $0$ nếu không tồn tại $i$ như vậy. $(a \& b)$ là phép toán AND bitwise.

Hãy tính $f(0) + f(1) + \dots + f(2^k - 1)$. Vì giá trị này có thể rất lớn, hãy in ra kết quả theo modulo $998\,244\,353$.

Dữ liệu vào

Dòng đầu tiên chứa hai số nguyên: $n, k$ ($1 \le n \le 100, 1 \le k \le 60$).

Dòng tiếp theo chứa $n$ số nguyên: $a_1, a_2, \dots, a_n$ ($0 \le a_i < 2^k$).

Dữ liệu ra

In ra một số nguyên duy nhất: $f(0) + f(1) + \dots + f(2^k - 1)$ theo modulo $998\,244\,353$.

Ví dụ

Dữ liệu vào 1

2 1
0 1

Dữ liệu ra 1

2

Dữ liệu vào 2

2 2
2 1

Dữ liệu ra 2

4

Dữ liệu vào 3

5 10
389 144 883 761 556

Dữ liệu ra 3

1118

Ghi chú

Trong ví dụ đầu tiên, $f(0) = 2, f(1) = 0$.

Trong ví dụ thứ hai, $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.