正文
增加 5 行删除 5 行
41 行未改动42434445464748495027 行未改动78798081828384858668 行未改动1551561571581591601611621639 行未改动17317417517617717817918018145 行未改动22722822923023123223323423521 行未改动41 行未改动if(a[i][j] >= 'a' && a[i][j] <= 'z' && f[i][j] == false){ans++;dfs(i, j);}cout << ans;return 0;}```# 二,题目分析27 行未改动cin >> n >> m;dfs(0, 0);cout << ans;return 0;}```这里就不具体注释了~## T2: T726113 求细胞数量### 类型:68 行未改动if(a[x + 1][y] == '#') cnt++;if(a[x][y + 1] == '#') cnt++;if(a[x + 1][y + 1] == '#') cnt++;return cnt == 3;}//判断是否合法void dfs(int x, int y){if(x < 1 || x > r || y < 1 || y > c) return;if(f[x][y] == true || a[x][y] == '.') return;f[x][y] = true;9 行未改动for(int j = 1; j <= c; j++)if(Bp(i, j) == true){cout << "Bad placement.";return 0;}else if(a[i][j] == '#' && f[i][j] == false){ans++;dfs(i, j);}45 行未改动}}if(flag == false) a[i][j] = 2;else a[i][j] = 3;}//标记数组for(int i = 1; i <= n; i++)for(int j = 1; j <= m; j++){if(a[i][j] != 2) continue;bool flag = true;21 行未改动41 行未改动42434445464748495027 行未改动78798081828384858668 行未改动1551561571581591601611621639 行未改动17317417517617717817918018145 行未改动22722822923023123223323423521 行未改动41 行未改动if(a[i][j] >= 'a' && a[i][j] <= 'z' && f[i][j] == false){ans++;dfs(i, j);}cout << ans;return 0;}```# 二,题目分析27 行未改动cin >> n >> m;dfs(0, 0);cout << ans;return 0;}```这里就不具体注释了~## T2: T726113 求细胞数量### 类型:68 行未改动if(a[x + 1][y] == '#') cnt++;if(a[x][y + 1] == '#') cnt++;if(a[x + 1][y + 1] == '#') cnt++;return cnt == 3;}//判断是否合法void dfs(int x, int y){if(x < 1 || x > r || y < 1 || y > c) return;if(f[x][y] == true || a[x][y] == '.') return;f[x][y] = true;9 行未改动for(int j = 1; j <= c; j++)if(Bp(i, j) == true){cout << "Bad placement.";return 0;}else if(a[i][j] == '#' && f[i][j] == false){ans++;dfs(i, j);}45 行未改动}}if(flag == false) a[i][j] = 2;else a[i][j] = 3;}//标记数组for(int i = 1; i <= n; i++)for(int j = 1; j <= m; j++){if(a[i][j] != 2) continue;bool flag = true;21 行未改动