QOJ.ac

QOJ

Limite de temps : 2.0 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓

#9700. 英杯

Statistiques

给定一棵大小为 $n$ 的无向树 $T = (V, E)$,对于每个 $k = 1, 2, \dots, n$,求有多少种 $1$ 到 $n$ 的排列 $a_1, a_2, \dots, a_n$ 恰好有 $k$ 个局部极小值,结果对 $998\,244\,353$ 取模。

若对于所有 $(u, v) \in E$,都有 $a_u < a_v$,则称顶点 $u$ 为局部极小值。换句话说,$a_u$ 小于其所有邻居的值。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 500$)。

接下来的 $n - 1$ 行,每行包含两个整数 $x_i$ 和 $y_i$,表示一条边的两个端点 ($1 \le x_i, y_i \le n$)。

输出格式

输出 $n$ 行,每行包含一个非负整数,分别对应 $k = 1, 2, \dots, n$ 的答案,结果对 $998\,244\,353$ 取模。

样例

输入格式 1

5
1 2
1 3
2 4
2 5

输出格式 1

28
54
38
0
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.