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$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.