luogu#P4726. 【模板】多项式指数函数(多项式 exp)

    ID: 3707 远端评测题 2000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>倍增递归O2优化快速傅里叶变换 FFT构造

【模板】多项式指数函数(多项式 exp)

Problem Description

Given a polynomial A(x)A(x) of degree n1n - 1, find a polynomial B(x)B(x) modulo xnx^n such that B(x)eA(x)B(x) \equiv \text e^{A(x)}. All coefficients are taken modulo 998244353998244353.

Input Format

The first line contains an integer nn.

The next line contains nn integers, representing the coefficients a0,a1,,an1a_0, a_1, \cdots, a_{n-1} of the polynomial in order.

It is guaranteed that a0=0a_0 = 0.

Output Format

Output nn integers, representing the coefficients a0,a1,,an1a_0, a_1, \cdots, a_{n-1} of the answer polynomial.

6
0 927384623 817976920 427326948 149643566 610586717
1 927384623 878326372 3882 273455637 998233543

Hint

For 100%100\% of the testdata, n105n \le 10^5.

Translated by ChatGPT 5