include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
const int N =10;
int n, k; // n * n 棋盘,要放 k 个棋子
char g[N][N]; // 存地图
int res; // 存答案
bool row[N]; // bool 数组存每一行是否放过棋子
int cnt; // 存目前放了多少个棋子
void dfs(int x)
{
if(cnt == k){
res;
return;
}
if(x > n){
return;
}
for(int i = 1; i <= n; i){
if(g[i][x] == ‘#’ && !row[i]){
cnt++;
row[i] = true;
dfs(x + 1);
cnt–;
row[i] = false;
}
}
dfs(x + 1);
}
int main()
{
while (cin >> n >> k) // 多组数据
{
if (n == -1 && k == -1) break; // 输入结束,跳出循环
for (int i = 1; i <= n; i )
{
for (int j = 1; j <= n; j ) cin >> g[i][j];
}
res = cnt = 0; // 初始化
memset(row, false, sizeof row); // 初始化
dfs(1); // 执行 dfs
cout << res << endl;
}
return 0;
}