問題一覧 > 通常問題

No.2583 Differential Equation (Enhanced version)

レベル : / AI推定難易度 : 3325 / 実行時間制限 : 1ケース 10.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 7
作問者 : NyaanNyaan / テスター : hos.lyric
お気に入りにしたユーザー ProblemId : 10349 / 自分の提出
問題文最終更新日: 2023-12-05 00:00:52
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Advent Calendar Contest 2023 (順位表) の他の問題:

Problem Statement

After solving Differential Equation, Nyaan came up with an enhanced version of that problem.
(For those who cannot view nowcoder: the original problem sets $A(x) = 0$ in the recurrence of this problem, gives $x_0$, and asks you to compute $F_N(x_0)$.)
You are given an integer $N$ and a polynomial $A(x) = \sum_{i=0}^{M-1} a_i x^i$.
Define a sequence of polynomials $F_0(x), F_1(x), \dots$ so that it satisfies the following recurrence: $$ F_k(x) = \begin{cases} x & (k=0) \\ A(x) F_{k-1} (x) + (x^2 - 1) F'_{k-1}(x) & (k \gt 0) \end{cases} $$ Let $F_N(x) = \sum_{i = 0}^\infty b_i x^i$. Find $b_0, b_1, \dots, b_{N+1}$ modulo $\text{mod } 998244353$.

Constraints

  • $0 \leq N \leq 10^5$
  • $1 \leq M \leq 10^5$
  • $0 \leq a_i \lt 998244353$
  • All input values are integers.

Input

The input is given in the following format.

$N\ M$
$a_0$ $a_1$ $\dots$ $a_{M-1}$

Output

Print $b_0,b_1,\dots,b_{N+1}$ separated by spaces, followed by a newline.

Sample

Sample 1
Input
3 1
0
Output
2 0 998244345 0 6

When $A(x) = 0$, as in the original problem, we have

  • $F_0(x) = x$
  • $F_1(x) = -1 + x^2$
  • $F_2(x) = -2x + 2x^3$
  • $F_3(x) = 2 - 8x^2 + 6x^4$
.

Sample 2
Input
3 3
1 2 3
Output
5 1 998244266 998244230 51

  • $F_0(x) = x$
  • $F_1(x) = -1 + x + 3x^2 + 3 x^3$
  • $F_2(x) = -2 - 7x - 6x^2 + 18x^3 + 24x^4 + 9 x^5$
  • $F_3(x) = 5 + x - 87x^2 - 123x^3 + 51x^4 + 207x^5 + 135x^6 + 27 x^7$
Note that only the first $5$ coefficients of $F_3(x)$ need to be printed.

Sample 3
Input
10 10
3 1 4 1 5 9 2 6 5 3
Output
995391385 49529776 618319120 44213854 513134421 679871357 699053302 203419219 632516059 28028663 180755779 327539189

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。