互不侵犯King
在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上
左下右上右下八个方向上附近的各一个格子,共8个格子。
Input
只有一行,包含两个数N,K ( 1 <=N <=9, 0 <= K <= N * N)
Output
方案数。
Sample Input
3 2
Sample Output
16
装压DP
第一维存
/**
* bzoj 1087 - D
* Accepted
* author:lemonoil
*/
#include<iostream>
#include<cstdio>
using namespace std;
int n,m,tot,sum[512];
long long f[10][