QOJ.ac

QOJ

حد الوقت: 3 s حد الذاكرة: 512 MB مجموع النقاط: 100

#1928. 史萊姆與數列

الإحصائيات

Slime 對數列很感興趣。他定義長度為 $n$ 的正整數數列 $p$ 如下:

  • 對於每個出現在 $p$ 中的 $k > 1$,必須至少存在一對索引 $i, j$,使得 $1 \leq i < j \leq n$,$p_i = k - 1$ 且 $p_j = k$。

對於給定的整數 $n$,所有長度為 $n$ 的好數列集合為 $s_n$。對於固定的整數 $k$ 和數列 $p$,令 $f_p(k)$ 為 $k$ 在 $p$ 中出現的次數。對於每個從 $1$ 到 $n$ 的 $k$,Slime 想要知道以下數值:

$$\left(\sum_{p\in s_n} f_p(k)\right)\ \textrm{mod}\ 998\,244\,353$$

輸入格式

第一行包含一個整數 $n$ ($1\le n\le 100\,000$)。

輸出格式

輸出 $n$ 個整數,其中第 $i$ 個整數應等於 $\left(\sum_{p\in s_n} f_p(i)\right)\ \textrm{mod}\ 998\,244\,353$。

範例

範例輸入 1

2

範例輸出 1

3 1

範例輸入 2

3

範例輸出 2

10 7 1

範例輸入 3

1

範例輸出 3

1

說明

在第一個範例中,$s=\{[1,1],[1,2]\}$。

在第二個範例中,$s=\{[1,1,1],[1,1,2],[1,2,1],[1,2,2],[2,1,2],[1,2,3]\}$。

在第三個範例中,$s=\{[1]\}$。

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.