Ex - Typical Convolution Problem

AtCoder
IDabc315_h
Time5000ms
Memory256MB
Difficulty
You are given a sequence $(A_1, A_2, \ldots , A_N)$. Let us define a sequence $(F_0, F_1, \ldots , F_N)$ by the following formulae. * $F_0 = 1$ * $F_n = A_n\displaystyle\sum_{i+j<n}F_iF_j$ $(1 \leq n \leq N)$ Find $F_1, \ldots , F_N$ modulo $998244353$. ## Constraints * $1 \leq N \leq 2 \times 10^5$ * $0 \leq A_i < 998244353$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $N$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
5
1 2 3 4 5
Output #1
1 6 48 496 6240

$F_1 = A_1F_0F_0 = 1$. $F_2 = A_2(F_0F_0+F_0F_1+F_1F_0) = 6$. Similarly, we find $F_3 = 48, F_4 = 496, F_5 = 6240$.
Input #2
3
12345 678901 2345678
Output #2
12345 790834943 85679169
API Response (JSON)
{
  "problem": {
    "name": "Ex - Typical Convolution Problem",
    "description": {
      "content": "You are given a sequence $(A_1, A_2, \\ldots , A_N)$. Let us define a sequence $(F_0, F_1, \\ldots , F_N)$ by the following formulae. *   $F_0 = 1$ *   $F_n = A_n\\displaystyle\\sum_{i+j<n}F_iF_j$ $(1 \\l",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 5000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc315_h"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a sequence $(A_1, A_2, \\ldots , A_N)$. Let us define a sequence $(F_0, F_1, \\ldots , F_N)$ by the following formulae.\n\n*   $F_0 = 1$\n*   $F_n = A_n\\displaystyle\\sum_{i+j<n}F_iF_j$ $(1 \\l...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments