#P5825. 排列计数

    ID: 6574 远端评测题 500ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>动态规划 DP组合数学Stirling 数生成函数快速傅里叶变换 FFT快速数论变换 NTT

排列计数

Problem Description

We say a permutation PP has kk ascents if and only if there exist kk positions ii such that Pi<Pi+1P_i < P_{i+1}.

Now given the permutation length nn, for all integers k[0,n]k \in [0, n], find how many permutations have exactly kk ascents.

Input Format

An integer nn.

Output Format

One line with n+1n + 1 integers. The ii-th integer indicates the number of permutations of length nn with exactly i1i - 1 ascents, taken modulo 998244353998244353.

4
1 11 11 1 0

Hint

For 100%100\% of the testdata, 1n2×1051 \leq n \leq 2 \times 10^5.

Translated by ChatGPT 5