問題一覧 > 通常問題

No.931 Multiplicative Convolution

レベル : / AI推定難易度 : 2000 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 70
作問者 : risujiroh / テスター : pockyny
お気に入りにしたユーザー ProblemId : 3473 / 自分の提出
問題文最終更新日: 2019-11-22 19:03:57
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 231 (順位表) の他の問題:

Problem Statement

You are given a prime $P$ and integer sequences $A_1,A_2,\dots,A_{P-1}$ and $B_1,B_2,\dots,B_{P-1}$.
Find the integer sequence $C_1,C_2,\dots,C_{P-1}$.
Here,
\[
C_k=\sum_{1 \le i,j \lt P\\ k=(i\times j) \mod P}A_iB_j
\]
and you should output these values modulo $998244353$.
(That is, $C_k$ is the sum of $A_iB_j$ over all pairs $(i,j)$ such that the remainder of $i\times j$ divided by $P$ is $k$.)

Constraints

・$2\le P\le 99991$
・$0\le A_i,B_i \lt 998244353$
・All input values are integers
・$P$ is prime

Input

$P$
$A_1\ A_2\ \dots\ A_{P-1}$
$B_1\ B_2\ \dots\ B_{P-1}$

Output

Output $C_1,C_2,\dots,C_{P-1}$ modulo $998244353$, separated by spaces.
Print a newline at the end.

Sample

Sample 1
Input
3
1 2
3 4
Output
11 10

$C_1=A_1B_1+A_2B_2\mod 998244353=11$
$C_2=A_1B_2+A_2B_1\mod 998244353=10$
as shown above.

Sample 2
Input
11
2 3 5 8 1 3 2 1 3 4
5 5 8 9 1 4 4 2 3 3
Output
172 129 138 127 162 138 149 148 129 116

Sample 3
Input
2
8886
112339
Output
1

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。