#P2401. 不等数列

    ID: 1401 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>动态规划,dp福建省历届夏令营

不等数列

Description

Take any permutation of 11 to nn, and then, between every two adjacent numbers in the permutation, insert > or < according to their relative value. Among all permutations, how many permutations have exactly kk symbols <$? The answer is taken modulo 20152015.

Note: A permutation of 1n1 \sim n refers to a sequence in which each of the nn numbers from 1n1 \sim n appears exactly once.

Input Format

A single line with two integers, representing nn and kk.

Output Format

A single integer representing the answer.

5 2
66

Hint

For 30%30\% of the testdata, n10n \leq 10.

For 100%100\% of the testdata, 0k<n10000 \leq k < n \leq 1000.

Translated by ChatGPT 5