QOJ.ac

QOJ

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

#8996. 俱乐部成员 2

Estadísticas

让我们重温一下 Byteotian 讨论俱乐部。回想一下,该俱乐部有 $2^n$ 名成员,每人都填写了一份包含 $n$ 个基本“是”或“否”问题的问卷。每位成员的回答当然可以编码为一个 $n$ 位的序列,这对应于 $0$ 到 $2^n - 1$ 范围内的整数。我们忽略问题表述的具体细节以及“是”与“否”答案到 $0$ 和 $1$ 的映射。没有两名成员给出相同的答案,即上述范围内的每个数字都存在。

俱乐部今天举行会议,有 $m$ 名成员出席,他们围坐在一张传统的圆桌旁。备受期待的“至关重要的问题”终于要在今天讨论了。为了充分准备辩论,出席的成员决定组成两个团队,每个团队都将进行各自的初步讨论。为了避免混乱,每个团队必须由坐在圆桌旁连续位置的成员组成。此外,为了进行全面且平衡的辩论,每个团队都应具备广泛的观点。换句话说,对于 $n$ 个基本问题中的每一个以及它的 $2$ 种可能的答案,我们要求:如果一个团队中有一名成员给出了这样的答案,那么另一个团队中也必须有成员给出同样的答案。

编写一个程序,确定将出席的成员分成两个团队的可能方案数。

输入格式

标准输入的第一行包含两个整数 $n$ 和 $m$ ($n \ge 2, m \ge 3$),分别表示基本问题的数量和出席成员的数量。第二行包含 $m$ 个互不相同的整数,取值范围在 $0$ 到 $2^n - 1$ 之间,表示圆桌旁连续成员对基本问题的完整回答。

输出格式

输出一个整数:符合上述规则的将出席成员分成两个团队的方案数。

样例

样例输入 1

4 5
1 10 0 11 3

样例输出 1

2

说明

样例说明:有两种可能的划分方案:$1\ 10 \mid 0\ 11\ 3$ 和 $3\ 1\ 10 \mid 0\ 11$。

子任务

测试集由以下子任务组成。每个子任务内可能包含多个测试点。

子任务 数据范围 分值
1 $n \le 15, m \le \min(2^n, 100)$ 15
2 $n \le 15, m \le \min(2^n, 5000)$ 20
3 $n \le 30, m \le \min(2^n, 100\,000)$ 45
4 $n \le 30, m \le \min(2^n, 2\,000\,000)$ 20

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.