QOJ.ac

QOJ

时间限制: 3 s 内存限制: 512 MB 总分: 100

#1928. スライムと数列

统计

Slimeは数列に興味がある。彼は長さ $n$ の正の整数列 $p$ が良いものであることを以下のように定義した。

  • $p$ に含まれるすべての $k > 1$ に対して、$p_i = k - 1$ かつ $p_j = k$ となるような添字の組 $i, j$ ($1 \leq i < j \leq n$) が少なくとも一つ存在する。

与えられた整数 $n$ に対して、長さ $n$ のすべての良い数列の集合を $s_n$ とする。固定された整数 $k$ と数列 $p$ に対して、$f_p(k)$ を $p$ における $k$ の出現回数とする。$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]\}$ である。

2番目の例では、$s=\{[1,1,1],[1,1,2],[1,2,1],[1,2,2],[2,1,2],[1,2,3]\}$ である。

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.