CF1000D Yet Another Problem On a Subsequence

题目描述

**题目大意:** 如果一个数组$[a_1,a_2,a_3,...,a_n]a_1=n-1$并且$a1>0$,这个数组就被叫为好数组,如果一个序列能正好分为多个好数组,ta就被叫为好序列,现在给定一个序列,求这个序列有多少好子序列,答案对$998244353$取模

输入格式

输出格式

说明/提示

In the first test case, two good subsequences — $ [a_1, a_2, a_3] $ and $ [a_2, a_3] $ . In the second test case, seven good subsequences — $ [a_1, a_2, a_3, a_4], [a_1, a_2], [a_1, a_3], [a_1, a_4], [a_2, a_3], [a_2, a_4] $ and $ [a_3, a_4] $ .