No.1693 Invasion
Problem Statement
There are $M$ cells arranged in a horizontal row. SF-kun will place indistinguishable coins on these cells by repeating the following operation $0$ or more times.
- Let $x$ be the number of cells without a coin at the start of the operation.
- Specify an integer $i$ satisfying $1\le i\le N$ and $A_i\le x$. Here, you may specify an $i$ that was chosen in a previous operation again. (If no $i$ satisfies the condition, the operation cannot be performed.)
- Freely choose $A_i$ cells that do not have a coin yet. However, the leftmost cell among the cells without a coin must be chosen.
- Place a coin on every chosen cell.
Find the number of possible coin configurations after finishing the operations, modulo $998244353$.
Here, two coin configurations are considered different if there exists a cell that has a coin in exactly one of them.
Input
$N\ \ M$ $A_1\ \cdots \ A_N$[Constraints]
- $1\le N\le 100$
- $N\le M\le 10^5$
- $1\le A_i\le M$
- $A_i\neq A_j$ if $i\neq j$
- All inputs are integers
Output
Output the answer $\bmod{998244353}$.
Sample
Sample 1
Input
2 3 1 2
Output
5
Representing a cell with a coin as 'o' and a cell without a coin as '.',
the following configurations are possible.
...o..oo.o.oooo
Note that operation sequences are not distinguished as long as the final configuration is the same.
Sample 2
Input
1 11 11
Output
2
Sample 3
Input
3 141 5 9 2
Output
113653783
Output the answer $\bmod{998244353}$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
eSeF
Kazun