#P7844. 「dWoi R2」FFT / 狒狒贴
「dWoi R2」FFT / 狒狒贴
Background
Gokuhara Gonta is trying to learn FFT...
Problem Description
Given a non-negative integer sequence of length , compute the sequence .
Here, is defined as:
$$\text{DFT}(b)_i=\sum_{j=0}^{2^n-1}b_j\omega^{ij}\mod{998244353}$$$$\omega\equiv3^{\frac{998244352}{2^n}}\pmod{998244353}$$Input Format
The first line contains two non-negative integers .
The next line contains non-negative integers .
Output Format
Output one line with non-negative integers .
3 3
1 2 3 4 5 6 7 8
288 831546728 224054051 383438562 998244321 614805727 774190238 166697561
Hint
Constraints
- Subtask 1 (10 pts): and .
- Subtask 2 (10 pts): .
- Subtask 3 (20 pts): .
- Subtask 4 (30 pts): .
- Subtask 5 (30 pts): no additional constraints.
For all testdata, , , .
Translated by ChatGPT 5