Universal Cup Judging System

Universal Cup

Süre Sınırı: 4.0 s Bellek Sınırı: 1024 MB Toplam puan: 100 Hack'lenebilir ✓
İstatistikler

小 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.