No.1618 Convolution?
問題文最終更新日: 2021-07-22 21:21:57
English (AI translation)
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.
Show the original
問題文一行コンテスト
(順位表)
の他の問題:
Problem Statement
You are given sequences $A = (A_1,\dots,A_N),B=(B_1,\dots,B_N)$ of length $N$. Find the sequence $C=(C_1,\dots,C_{2N})$ of length $2N$ defined by $\displaystyle C_k=\sum_{i+j=k} \left(i\times A_j + j \times B_i\right)$.
Constraints
- All input values are integers.
- $1 \le N\le 2 \times 10^5$
- $0 \le A_i,B_i \le 2 \times 10^5$
Input
$N$ $A_1$ $A_2$ $\dots$ $A_N$ $B_1$ $B_2$ $\dots$ $B_N$
Output
Output the sequence $C$ in the following format.
$C_1$ $C_2$ $\dots$ $C_{2N}$
Sample
Sample 1
Input
3 1 2 3 4 5 6
Output
0 5 17 38 39 27
Sample 2
Input
5 3 1 4 1 5 9 2 6 4 8
Output
0 12 27 52 82 125 96 109 77 65
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nok0
だれ