Universal Cup Judging System

Universal Cup

时间限制: 4.0 s 内存限制: 1024 MB 总分: 100 可 Hack ✓
统计

小 N 最近學識咗 MEX。MEX(Minimum Excluded,最細未出現值)係指唔喺數組入面出現嘅最細非負整數。例如:$\operatorname{{MEX}}([3, 1, 0]) = 2$, $\operatorname{{MEX}}([2, 2, 1]) = 0$, $\operatorname{{MEX}}([0, 3, 1, 2]) = 4$。小 N 定義,對於一個長度為 $k$ 嘅非負整數數組 $[b_1, b_2, \dots, b_k]$,如果 $\operatorname{MEX}([b_1, b_2, \dots, b_k]) = k$,就稱數組 $b$ 為一個 $k$-好數組。

畀定一個正整數 $n$,對於一個 $n$-好數組 $p_1, p_2, \dots, p_n$,小 N 定義函數 $f(p)$ 為滿足以下條件嘅整數對 $(l, r)$ 嘅數量:

  • $1 \le l \le r \le n$;
  • $p_l, \dots, p_r$ 係一個 $(r - l + 1)$-好數組。

小 N 已經證明咗以下定理:對於任意 $n$-好數組 $p$,都有 $1 \le f(p) \le n$。而家,小 N 希望你可以對每個 $i \in [1, n]$,求出滿足 $f(p) = i$ 嘅 $n$-好數組 $p$ 嘅數量。當然,呢個數量可能會好大,所以你需要輸出佢對 $998\,244\,353$ 取模之後嘅結果。

輸入格式

輸入只有一行,包含一個整數 $n$($1 \le n \le 10^5$)。

輸出格式

輸出一行,包含 $n$ 個整數,其中第 $i$ 個整數代表滿足 $f(p) = i$ 嘅 $n$-好數組 $p$ 嘅數量,對 $998\,244\,353$ 取模。

樣例

樣例輸入 1

1

樣例輸出 1

1

樣例輸入 2

3

樣例輸出 2

0 2 4

樣例輸入 3

7

樣例輸出 3

0 2312 1424 728 352 160 64

說明

對於 $n = 3$,可以證明共有六個 $3$-好數組,佢哋對應嘅函數值分別係:

$f([0, 1, 2]) = 3$, $f([0, 2, 1]) = 2$, $f([1, 0, 2]) = 3$, $f([1, 2, 0]) = 2$, $f([2, 0, 1]) = 3$, $f([2, 1, 0]) = 3$

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.