QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 256 MB 満点: 100

#10177. Bitvzhuh

統計

Daniyar 最近学会了一个名为“Bitvzhuh”的咒语。虽然这是一个非常高阶的咒语,但 Daniyar 已经完全掌握了它,并解开了它最深层的秘密。

“Bitvzhuh”在作用于一个整数集合时,会将该集合转换为一个新的集合,其中包含初始集合中所有元素对的异或和。

形式化地说,假设你有一个大小为 $n$ 的集合 $A = \{a_1, a_2, \dots, a_n\}$。经过一次“Bitvzhuh”后,$A$ 变为集合 $\{a_i \oplus a_j \mid 1 \le i < j \le n\}$,其中 $\oplus$ 表示按位异或运算。

给定初始集合和数字 $k$,请判断 Daniyar 是否可以施放“Bitvzhuh”咒语非零次,使得最终得到的集合包含范围 $[1, 2^k - 1]$ 内的每一个整数。

输入格式

第一行包含两个整数 $n$ 和 $k$ ($3 \le n \le 10^6, 2 \le k \le 62$):初始集合的大小和参数。

第二行包含 $n$ 个不同的整数 $a_1, a_2, \dots, a_n$ ($1 \le a_i < 2^k$):初始集合的元素。

输出格式

如果经过非零次“Bitvzhuh”咒语后,集合包含范围 $[1, 2^k - 1]$ 内的每一个整数,则输出一行单词“Yes”。否则,输出一行单词“No”。

样例

样例输入 1

4 3
1 2 3 4

样例输出 1

Yes

样例输入 2

4 3
1 2 4 7

样例输出 2

No

说明

在第一个样例中,经过两次施法后达到目标: $\{1, 2, 3, 4\} \to \{1, 2, 3, 5, 6, 7\} \to \{1, 2, 3, 4, 5, 6, 7\}$。

在第二个样例中,第一次施法将集合 $\{1, 2, 4, 7\}$ 变为 $\{3, 5, 6\}$,之后集合不再改变。

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.