#P2513. [HAOI2009] 逆序对数列

    ID: 1528 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>动态规划,dp递推2009河南各省省选前缀和

[HAOI2009] 逆序对数列

Description

For a sequence {ai}\{a_i\}, if i<ji < j and ai>aja_i > a_j, then we call aia_i and aja_j an inversion pair.

For any sequence formed by the natural numbers 1n1 \sim n (i.e., a permutation), it is easy to compute how many inversions it has. How many such sequences have exactly kk inversions?

Input Format

The first line contains two integers n,kn, k.

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 1000010000.

4 1
3

Hint

【Sample Explanation】

The following 33 sequences each have exactly 11 inversion: {1,2,4,3}\{1,2,4,3\}; {1,3,2,4}\{1,3,2,4\}; {2,1,3,4}\{2,1,3,4\}.

Constraints

  • For 30%30\% of the testdata, n12n \le 12.
  • For 100%100\% of the testdata, n1000n \le 1000, k1000k \le 1000.

Translated by ChatGPT 5