#P14993. 【模板】Inverse Chirp Z-Transform

    ID: 16903 远端评测题 5000ms 2048MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>多项式快速数论变换 NTT模板题

【模板】Inverse Chirp Z-Transform

题目背景

This problem comes from the repository https://github.com/yosupo06/library-checker-problems.

题目描述

Given integers N,a,rN,a,r and integer sequence y0,y1,,yN1y_0,y_1,\dots,y_{N-1}. It is guaranteed that ari≢arj(mod998244353)ar^i\not\equiv ar^j \pmod{998244353} for 0i<jN10\leq i < j\leq N-1.

Calculate a polynomial f(x)=i=0N1cixiZ[x]f(x)=\sum_{i=0}^{N-1} c_i x^i \in \mathbb{Z}[x] s.t. f(ari)yi(mod998244353)f(ar^i)\equiv y_i \pmod{998244353} is satisfied for each ii.

Also, 0ci<9982443530\leq c_i< 998244353 must be satisfied.

输入格式

N a rN\ a\ r
y0 y1  yN1y_0\ y_1\ \dots\ y_{N-1}

输出格式

c0 c1  cN1c_0\ c_1\ \dots\ c_{N-1}

4 2 10
17 1241 120401 12004001
1 2 3 0
1 0 0
100
100

提示

  • 0N2190\leq N\leq 2^{19}
  • 0a<9982443530\leq a < 998244353
  • 0r<9982443530\leq r < 998244353
  • 0yi<9982443530\leq y_i < 998244353
  • $ar^i\not\equiv ar^j \pmod{998244353}\,(0\leq i<j\leq N-1)$