問題一覧 > 通常問題

No.1963 Subset Mex

レベル : / AI推定難易度 : 2750 / 実行時間制限 : 1ケース 4.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 14
作問者 : 👑 tute7627 / テスター : PCTprobability
お気に入りにしたユーザー ProblemId : 7836 / 自分の提出
問題文最終更新日: 2022-05-27 20:17:31
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 345 (順位表) の他の問題:

Problem Statement

There is a multiset $S$ consisting of $N$ integers. Initially, the $i$-th element of $S$ is $S_i$.

You may perform the following operation on $S$ any number of times, possibly $0$ times.

  • Choose any number of elements of $S$, at least $1$. Remove the chosen elements from $S$, and add to $S$ the smallest non-negative integer not contained in the chosen elements.

Find the number of possible multisets $S$ after the operations, modulo $998244353$.

Two multisets are considered different if there exists a number $X$ whose number of occurrences differs between the two multisets.

Input

$N$
$S_1 \ S_2 \ \dots \ S_N$

  • All inputs are integers.
  • $1 \le N \le 100$
  • $0 \le S_i \le 100$

Output

Find the number of possible multisets $S$ after the operations, modulo $998244353$. Print a newline at the end.

Sample

Sample 1
Input
2
1 2
Output
8

$\{0\},\{0,0\},\{0,1\},\{0,2\},\{1\},\{1,1\},\{1,2\},\{2\}$ are possible.
For example, performing the operation on $1$ gives $\{0,2\}$, and then choosing both elements and performing the operation gives $\{1\}$.

Sample 2
Input
1
100
Output
3

Sample 3
Input
3
3 3 3
Output
21

Sample 4
Input
11
3 8 3 4 5 6 7 6 6 7 4
Output
22265

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。