No.2349 Power!! (Hard)
問題文最終更新日: 2023-06-10 08:45:37
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.
Back to the original
yukicoder contest 392
(順位表)
の他の問題:
Problem Statement
Solve the following problem for $T$ cases.
Find the remainder when $\displaystyle \sum_{i=0}^{N-1} A^{i^2}$ is divided by $998244353$.
Input
$T$
$\text{case}_1$
$\text{case}_2$
$\vdots$
$\text{case}_T$
Each case is given in the following format.
$A$ $N$
- $1 \le T \le 2000$
- $1 \le A,N \le 998244352$
- All inputs are integers.
Output
Print $T$ lines. On the $i$-th line, print the answer for $\text{case}_i$.
Sample
Sample 1
Input
3 2 4 1 1 789454405 998244352
Output
531 1 253186705
For the $1$st case: $2^0+2^1+2^4+2^9=1+2+16+512=531$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Forested
ぷら