AtCoder Japan Open -予選-(AtCoder Regular Contest 186)
E
Missing Subsequence
AtCoder
⌀ 3178
原题
← D→
翻译中…

Problem Statement

翻译中…

You are given a sequence of integers $(X_1,\dots,X_M)$ of length $M$ consisting of $1,\dots,K$.

翻译中…

Find the number of sequences $(A_1,\dots,A_N)$ of length $N$ consisting of $1,\dots,K$ that satisfy the following condition, modulo $998244353$:

翻译中…
  • Among all sequences of length $M$ consisting of $1,\dots,K$, the only sequence that cannot be obtained as a (not necessarily contiguous) subsequence of $(A_1,\dots,A_N)$ is $(X_1,\dots,X_M)$.
翻译中…

Constraints

翻译中…
  • $2\le M,K \le N \le 400$
  • $1\le X_i \le K$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N M K
X_1 X_2 \dots X_M

翻译中…

Output

翻译中…

Print the number of sequences satisfying the condition, modulo $998244353$.

翻译中…

样例

Input #1
5 2 3
1 1
Output #1
4
The following four sequences satisfy the condition: - $(2, 3, 1, 2, 3)$ - $(2, 3, 1, 3, 2)$ - $(3, 2, 1, 2, 3)$ - $(3, 2, 1, 3, 2)$
Input #2
400 3 9
1 8 6
Output #2
417833302
Input #3
29 3 10
3 3 3
Output #3
495293602
Input #4
29 3 10
3 3 4
Output #4
0
题目信息
题号
arc186_e
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。