CF1671F.Permutation Counting
省选/NOI-
通过率:0%
时间限制:4.00s
内存限制:512MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Calculate the number of permutations p of size n with exactly k inversions (pairs of indices (i,j) such that i<j and pi>pj) and exactly x indices i such that pi>pi+1.
Yep, that's the whole problem. Good luck!
计算长度为 n 的排列 p 的个数,使得该排列恰好有 k 个逆序对(即满足 i<j 且 pi>pj 的下标对 (i,j) 的个数),且恰好有 x 个下标 i 满足 pi>pi+1。
没错,这就是整个题目。祝你好运!
输入格式
The first line contains one integer t (1≤t≤3⋅104) — the number of test cases.
Each test case consists of one line which contains three integers n, k and x (1≤n≤998244352; 1≤k≤11; 1≤x≤11).
第一行包含一个整数 t(1≤t≤3⋅104)—— 测试用例的数量。
每个测试用例由一行组成,该行包含三个整数 n、k 和 x(1≤n≤998244352;1≤k≤11;1≤x≤11)。
输出格式
For each test case, print one integer — the answer to the problem, taken modulo 998244353.
对于每个测试用例,输出一个整数——该问题的答案对 998244353 取模的结果。
输入输出样例
输入#1
5 10 6 4 7 3 1 163316 11 7 136373 11 1 325902 11 11
输出#1
465 12 986128624 7636394 57118194
输入解题思路,AI测评打分。不知道怎么写?