#P2513. [HAOI2009] 逆序对数列
[HAOI2009] 逆序对数列
Description
For a sequence , if and , then we call and an inversion pair.
For any sequence formed by the natural numbers (i.e., a permutation), it is easy to compute how many inversions it has. How many such sequences have exactly inversions?
Input Format
The first line contains two integers .
Output Format
Output a single integer: the number of sequences that satisfy the condition. Since this number can be very large, you only need to output the result modulo .
4 1
3
Hint
【Sample Explanation】
The following sequences each have exactly inversion: ; ; .
Constraints
- For of the testdata, .
- For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号