問題一覧 > 通常問題

No.2994 Power Inner Product

レベル : / AI推定難易度 : 2025 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 16
作問者 : ジュ・ビオレ・グレイス / テスター : 👑 p-adic
お気に入りにしたユーザー ProblemId : 11683 / 自分の提出
問題文最終更新日: 2024-12-15 17:24:19
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
Advent Calendar Contest 2024 (順位表) の他の問題:

Problem Statement


Let $p = 1009$.
For the integers $K_0, K_1, \cdots, K_M$ given in the input, each at least $0$ and less than $p$, let $K := \sum_{j=0}^M K_j p^j$.
For the non-negative integers $A_{1,0}, \cdots, A_{1,N}$ given in the input, define $A_{k, 0}, \cdots, A_{k, N}$ inductively by the following operation:

$A_{k+1, n} := \sum_{i = 0}^{n} A_{k, i}A_{1, n-i}$

Output $A_{K, 0}, \cdots, A_{K, N}$ modulo $p$, in this order.

Input

$M \ N$
$K_0 \ \cdots \ K_M$
$A_{1, 0} \ \cdots \ A_{1, N}$

$0 \leq M < 4 \times 10^5,$
$0 \leq N < 2 \times 10^3,$
$0 \leq K_m < p \ (m = 0, \cdots, M, \ K_M \neq 0),$
$0 \leq A_{1, n} < p \ (n = 0, \cdots, N),$

Output

Output $A_{K, 0}, \cdots, A_{K, N}$ modulo $p$, in this order, separated by single spaces.

Sample

Sample 1
Input
0 0
1
789
Output
789

Sample 2
Input
0 3
3
1 1008 0 0
Output
1 1006 3 1008

Sample 3
Input
1 5
99 100
1 2 3 4 5 6
Output
1 198 530 691 669 390

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