QOJ.ac

QOJ

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

#6196. Minimum Element Problem

統計

我们称两个排列 $p_1, p_2, \dots, p_n$ 和 $q_1, q_2, \dots, q_n$ 是等价的,当且仅当对于每一对 $(i, j)$ ($1 \le i \le j \le n$),$p_i, p_{i+1}, \dots, p_j$ 的最小值所在的下标与 $q_i, q_{i+1}, \dots, q_j$ 的最小值所在的下标相同。

给定 $x$ 和 $y$,考虑所有满足 $p_x = y$ 的 $\{1, 2, \dots, n\}$ 的排列 $p$ 构成的集合。求出能从该集合中选出的互不等价的排列的最大数量。输出该数量对 $998244353$ 取模的结果。

这个问题太简单了,所以请输出对于每一个 $y = 1, 2, \dots, n$ 的答案。

输入格式

第一行包含 $n, x$ ($1 \le n \le 5 \times 10^5, 1 \le x \le n$)。

输出格式

输出 $n$ 行,分别为对应 $y = 1, 2, \dots, n$ 的答案。

样例

输入 1

5 2

输出 1

5
10
16
20
14

输入 2

10 5

输出 2

588
1176
2716
4942
7407
9101
9636
9167
7596
4862

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.