#H. [ABC315Ex] Typical Convolution Problem

    Type: Default 5000ms 1024MiB

[ABC315Ex] Typical Convolution Problem

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[ABC315Ex] Typical Convolution Problem

题面翻译

题目描述

给定一个长为 nn 的序列 aa,按如下方法计算 f(x)f(x)

  • f(0)=1f(0)=1;
  • 当整数 m[1,n]m\in[1,n] 时,$f(m)=a_m\times (\displaystyle\sum_{i+j\lt m} f(i)\times f(j))$。

对于每个整数 i[1,n]i\in[1,n],计算 f(i)f(i) mod\bmod 998244353998244353 的值。

输入格式

第一行为序列长度 nn,第二行输入 nn 个整数表示序列 aa

输出格式

依次输出 f(1)f(1)f(2)f(2),…,f(n)f(n)998244353998244353 取模后的值,相邻两个数之间以单个空格隔开。

说明/提示

数据规模与约定

1n2×1051\le n\le 2\times 10^5ai[0,998244352]a_i\in[0,998244352]

样例 #1

样例输入 #1

5
1 2 3 4 5

样例输出 #1

1 6 48 496 6240

样例 #2

样例输入 #2

3
12345 678901 2345678

样例输出 #2

12345 790834943 85679169

样例解释1

F1 = A1F0F0 = 1 F_1\ =\ A_1F_0F_0\ =\ 1 F2 = A2(F0F0+F0F1+F1F0) = 6 F_2\ =\ A_2(F_0F_0+F_0F_1+F_1F_0)\ =\ 6 。 同理可得F3 = 48, F4 = 496, F5 = 6240 F_3\ =\ 48,\ F_4\ =\ 496,\ F_5\ =\ 6240

9月19日周二晚上集训赛

Not Attended
Status
Done
Rule
IOI
Problem
8
Start at
2023-9-19 19:00
End at
2023-9-19 21:00
Duration
2 hour(s)
Host
Partic.
30