問題一覧 > 通常問題

No.1693 Invasion

レベル : / AI推定難易度 : 1900 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 126
作問者 : eSeF / テスター : 👑 Kazun ygussany
お気に入りにしたユーザー ProblemId : 6643 / 自分の提出
問題文最終更新日: 2021-09-29 17:45:49
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 316 (順位表) の他の問題:

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.o
  • ooo

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もしくは右上の雲マークをクリックしてアカウントを作成してください。