4582 F

时间限制1 S
内存限制128 MB
通过率0%(0 / 0)
题目描述

Given the sequence a[0 . . . n] ,ask the value of




mod 998241383

wikipedia: k-permutations of n are the different ordered arrangements of a k-element subset of an n-set (sometimes called variations or arrangements in the older literature). These objects are also known as partial permutations or as sequences without repetition, terms that avoid confusion with the other, more common, meaning of ”permutation”. The number of such k-permutations of n is denoted variously by such symbols as Pkn or P(n, k),and its value is given by the product P(n, k) = n · (n − 1) · (n − 2)· · ·(n − k + 1) | {z } k factors ,which is 0 when k > n, and otherwise is equal to n! (n−k)! .

Assume that P(i, 0) = 1, P(0, 0) = 1

输入格式
The first line contains an integer T(T ≤ 3) — the number of test cases you need to solve. The first line of each test case contains an integer n(1 ≤ n ≤ 105). The second line contains n space-separated integers a0, a1, · · · , an(0 ≤ ai ≤ i) — the elements of the array a.
输出格式
For each test case, print the result mod naughty 998241383
输入输出样例
输入复制
1
5
0 1 1 3 2 4
输出复制
245
上传者
提交记录查看记录
题目类型传统
评测方式Special Judge
提交 / 通过0 / 0
相关讨论
暂无讨论