No.2005 Sum of Power Sums
レベル :
/ AI推定難易度 : 2500
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 19
作問者 : 👑
to-omer
/ テスター :
chineristAC
ygussany
タグ : / 解いたユーザー数 19
作問者 : 👑
問題文最終更新日: 2022-07-05 22:14:53
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 351
(順位表)
の他の問題:
Problem Statement
Over all sequences $A$ of non-negative integers of length $N$ satisfying $\displaystyle \sum_{i=1}^{N}A_i\le M$, find the sum of $\displaystyle \sum_{i=1}^{N}A_i^{K_i}$, modulo $998244353$.
Constraints
- All input values are integers.
- $1\le N\le 2\times 10^5$
- $1\le M\le 10^{18}$
- $1\le K_i\le 5000\ (1\le i\le N)$
Input
$N$ $M$ $K_1$ $K_2$ $\dots$ $K_N$
Output
Output the integer answer on 1 line.
Sample
Sample 1
Input
2 2 1 2
Output
10
- When $A=(0,\ 0)$, $0^1+0^2=0$
- When $A=(0,\ 1)$, $0^1+1^2=1$
- When $A=(0,\ 2)$, $0^1+2^2=4$
- When $A=(1,\ 0)$, $1^1+0^2=1$
- When $A=(1,\ 1)$, $1^1+1^2=2$
- When $A=(2,\ 0)$, $2^1+0^2=2$
Therefore, the answer is $0+1+4+1+2+2=10$.
Sample 2
Input
1 10 4
Output
25333
Sample 3
Input
3 14159265 3589 793 2384
Output
90586659
Find the remainder when divided by $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。