内存限制:256 MB
时间限制:4 S
题面:Markdown
评测方式:文本比较
上传者:
提交:1
通过:1
Given a sequence $a$ length $n$ and a set $S$ size $m$.
Count the number of sequence $0=p_0<p_1<p_2<\cdots<p_k<p_{k+1}=n$ such that:
For any $0 \leq i \leq k, x \in S$ and $1 \leq j \leq n, \sum_{l=p_i+1}^{p_{i+1}}\left[a_l=j\right] \neq x$.
Line $1$: Two integers $n,m$.
Line $2$: $n$ integers, indicating sequence $a$.
Line $3$: $m$ integers, indicating set $S$.
Line $1$: An integer, the answer, modulo $998244353$.
$1\leq n\leq 2\times10^5$.
$0\leq m\leq 10$.
$1\leq a_i\leq n$.
All integers in set $S$ are between $1$ and $n$.