#include #include #include #include #include #include #include //notice the '#' can be placed. using namespace std; const int MAXN = 10; int n, m; int ans = 0; char my_map[MAXN][MAXN]; bool vis_row[MAXN]; //vis_row[i], i row is visited. bool vis_col[MAXN]; //vis_col[j], j col is visited. bool judge(int x, int y){ if(x<0 || x>=n || y<0 || y>=n || my_map[x][y]!='#') return false; if(vis_row[x] || vis_col[y]) return false; return true; } void DFS(int x, int y, int step){ //int xx, yy; if(step == m) {ans++; return;} for(int i=x; i