当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6991:Increasing Subsequence

题目描述
In a sequence of integers $a_1, a_2, \ldots, a_n$, if an increasing subsequence is not a subsequence of other increasing subsequences, we call it maximal. A subsequence is a sequence we can get by erasing some (possibly zero) elements from the original sequence.

Finding or counting the longest increasing subsequence is a classic problem. Now Yukikaze wants you to count the number of maximal increasing subsequences in some permutations modulo $998244353$. A permutation of length $n$ is a sequence of numbers such that every number from $1$ to $n$ appears exactly once.
输入解释
The first line of the input contains a single integer $T$ $(1 \leq T \leq 10^4)$, denoting the number of test cases.

The first line of each test case contains a single integer $n$ $(1 \leq n \leq 10^5)$, denoting the length of the permutation.

The second line of each testcase contains $n$ integers $a_1, a_2, \ldots, a_n$ $(1 \le a_i \le n)$, denoting the permutation. It's guaranteed that every number from $1$ to $n$ appears exactly once.

The sum of $n$ in all test case will not exceed $2 \times 10^5$.
输出解释
For each test case, output a single integer denoting the number of the maximal increasing subsequences in the given permutation modulo $998244353$.
输入样例
2
4
2 1 4 3
5
1 5 2 4 3
输出样例
4
3

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6991

最后修改于 2021-10-23T19:10:55+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 262144/262144K(Java/Others)