No.2625 Bouns Ai
タグ : / 解いたユーザー数 100
作問者 : 👑
aplysiaSheep
Problem Statement
In a certain game, a score is awarded according to the content of the play.
The score metrics consist of a provisional score and bonus points, and the sum of the provisional score and the bonus points is called the true score. Here, the provisional score, the bonus points, and the true score are all always integers between $0$ and $10^5$, inclusive.
Now, $N$ players played this game, and the bonus points of the $i$-th player were $A_i$.
In addition, the following is known about the scores of these $N$ players.
- Letting $B_i$ be the provisional score of the $i$-th player, $B_1 \leq B_2 \leq \dots \leq B_N$ holds.
- Letting $C_i$ be the true score of the $i$-th player, $C_1 \leq C_2 \leq \dots \leq C_N$ holds.
Find the total number of possible combinations of the true scores of the $N$ players, modulo $998244353$.
Note that $2$ combinations are distinguished if there exists a player whose true score differs between them.
Constraints
- All inputs are integers.
- $1 \leq N \leq 200$
- $0 \leq A_i \leq 10^5$
Input
The input is given from standard input in the following format.
$N$ $A_1$ $A_2$ $\dots$ $A_N$
Output
Output the answer.
Sample
Sample 1
Input
2 1 99998
Output
6
The following $6$ ways are possible.
- $B = (0, 0), C = (1, 99998)$
- $B = (0, 1), C = (1, 99999)$
- $B = (0, 2), C = (1, 100000)$
- $B = (1, 1), C = (2, 99999)$
- $B = (1, 2), C = (2, 100000)$
- $B = (2, 2), C = (3, 100000)$
Sample 2
Input
1 0
Output
100001
There is only $1$ player and the bonus points are $0$, so the provisional score and the true score have the same value. That value can be any of the $100001$ values between $0$ and $100000$, inclusive.
Sample 3
Input
9 31 41 59 26 53 58 97 93 23
Output
454568508
Output the remainder when divided by $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。