QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100

#9637. S>a<M

الإحصائيات

题目描述

对于大小不超过 $n$,且每个元素都是 $[0,n]$ 中的整数的可重集合 $S$,定义一次操作 $\text{SaM}$(Select and Mex)为:

  1. 取出任意一个非空可重子集 $T$。
  2. 计算 $x = \text{mex} \, T$。
  3. 将 $T$ 从 $S$ 中删除后,再将 $x$ 加入 $S$。

对于 $S$,令 $f(S)$ 表示对 $S$ 做任意多次 $\text{SaM}$ 操作后,$S$ 的不同元素的个数的最大值。

SA 酱现在给你了 $S$ 的一个子集 $T$,希望你求出所有满足下列要求的大小为 $n$ 的 $S$ 的个数。

  • $T \subseteq S$
  • $0 \in S$
  • $f(S) = k$

你只需要求出答案对 $10^9+7$ 取模的余数即可。

输入格式

第一行两个整数 $n$ 和 $\lvert T \rvert$。

若 $\lvert T \rvert \ne 0$,第二行 $\lvert T \rvert$ 个整数表示 $T$ 中的元素。

输出格式

对于每个 $k = 1, 2, \dots, n$,输出对应的答案。

样例 1

样例输入 1
3 0
样例输出 1
0 3 7

样例 2

样例输入 2
6 2
2 2
样例输出 2
0 0 0 50 30 4

样例 3

样例输入 3
12 4
2 5 5 6
样例输出 3
0 0 0 0 0 470 5530 17352 22065 4655 308 8

样例解释

$S = \{0, 1, 1\}, \{0, 0, 1\}, \{0, 0, 0\}$ 时,有 $f(S) = 2$;对于其它的 $S$,都有 $f(S) = 3$。

数据范围

对于所有数据,满足 $2 \le n \le 200$,$0 \le \lvert T \rvert \le n$,$T$ 中元素 $\in [0,n] \cap \mathbb{Z}$。

Subtask 分值 特殊性质
$1$ $15$ $\lvert T \rvert = n$
$2$ $15$ $n \le 12$
$3$ $15$ $n \le 30$
$4$ $20$ $n \le 70$
$5$ $15$ $n \le 120$
$6$ $20$ $n \le 200$

Discussions

About Discussions

The discussion section is only for posting: Editorials, 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. Submitting multiple issues may cause your account to be banned.
  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.