QOJ.ac

QOJ

Time Limit: 5 s Memory Limit: 2048 MB Total points: 100 Hackable ✓

#1097. 多项式复合

統計

给定 $F(x) = \displaystyle \sum_{i=0}^{n-1} f_ix^i$ 与 $G(x) = \displaystyle \sum_{i=0}^{n-1} g_ix_i$,其中 $g_0 = 0$。

求 $H(x) = F(G(x)) \pmod{x^{n}}$ 的各项系数,取模 $998\,244\,353$。

输入格式

输入的第一行包含一个整数 $N$。

接下来一行,包含 $N$ 个整数 $f_0, f_1, \cdots, f_{n-1}$。保证对每个 $i$ 有 $0 \leq f_i < 998\,244\,353$。

接下来一行,包含 $N$ 个整数 $g_0, g_1, \cdots, g_{n-1}$。保证有 $g_0 = 0$,且对每个 $i$ 有 $0 \leq g_i < 998\,244\,353$。

输出格式

输出一行,包含 $N$ 个整数 $h_0, h_1, \cdots, h_{n-1}$。

样例数据

样例输入

6
1 1 4 5 1 4
0 9 0 2 2 8

样例输出

1 9 324 3647 6707 238778

子任务

对于所有的数据,我们有 $1 \leq N \leq 200\,000$。

子任务 $N \leq $
$1$ $10$
$2$ $1\,000$
$3$ $3\,000$
$4$ $5\,000$
$5$ $10\,000$
$6$ $25\,000$
$7$ $50\,000$
$8$ $100\,000$
$9$ $150\,000$
$10$ $200\,000$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.