Score : 650 points
问题描述
你已给定一个序列 (A1,A2,…,AN)。让我们通过以下公式定义一个序列 (F0,F1,…,FN)。
- F0=1
- Fn=Ani+j<n∑FiFj (1≤n≤N)
求 F1,…,FN 对于模数 998244353 的结果。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence (A1,A2,…,AN). Let us define a sequence (F0,F1,…,FN) by the following formulae.
- F0=1
- Fn=Ani+j<n∑FiFj (1≤n≤N)
Find F1,…,FN modulo 998244353.
Constraints
- 1≤N≤2×105
- 0≤Ai<998244353
- All input values are integers.
The input is given from Standard Input in the following format:
N
A1 A2 … AN
Output
Print F1,…,FN modulo 998244353 in this order, with spaces in between.
5
1 2 3 4 5
Sample Output 1
1 6 48 496 6240
F1=A1F0F0=1. F2=A2(F0F0+F0F1+F1F0)=6. Similarly, we find F3=48,F4=496,F5=6240.
3
12345 678901 2345678
Sample Output 2
12345 790834943 85679169
update @ 2024/3/10 09:01:27