QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 64 MB Total points: 60

#17566. ZBRKA

Statistics

考虑一个长度为 $N$ 的整数序列,其中 $1$ 到 $N$ 之间的每个整数恰好出现一次。

如果序列中较早出现的数字大于较晚出现的数字,则称这一对数是混乱的

序列的混乱度是其中混乱对的数量。例如,序列 $(1, 4, 3, 2)$ 的混乱度为 $3$,因为其中有 $3$ 个混乱对:$(4, 3)$、$(4, 2)$ 和 $(3, 2)$。

编写一个程序,计算长度为 $N$ 且混乱度恰好为 $C$ 的序列数量。

输入格式

输入只有一行,包含两个整数 $N$($1 \le N \le 1000$)和 $C$($0 \le C \le 10000$)。

输出格式

输出符合条件的序列数量模 $1000000007$ 的结果。

样例

输入样例 1

10 1

输出样例 1

9

输入样例 2

4 3

输出样例 2

6

输入样例 3

9 13

输出样例 3

17957

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.