当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5180:chess

题目描述
Given an $n*n$ chessboard where you want to place some chess kings and $k$ chess rooks. You have to find the number of ways that no two rooks attack each other, no two kings attack each other, no rooks attack kings. (But kings can attack rooks.)

Because the result may be very large, please print the result modulo $1000000007$.

P.S. Two rooks attack each other if and only if thay are on the same rows or same columns.
Two kings attack each other if and only if one is on the other's adjacent 8 cells (vertical, horizontal or diagonal).
A rook attack a king if and only if the king is on the same rows or the same columns as the rook.
输入解释
The first line contains an integer $T$(about 10),indicating the number of cases.
Each test case begins with two integers $n(1 \leq n \leq 15)$ and $k(0 \leq k \leq 15)$.
输出解释
For each case, output an integer means the answer mod $1000000007$.
输入样例
5
1 0
1 1
2 0
2 1
2 2
输出样例
2
1
5
8
2
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #31

源链接: HDU-5180

最后修改于 2020-10-25T23:20:29+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 131072/131072K(Java/Others)