AcWing 1097 池塘计数
连通块问题,Flood Fill(洪水覆盖)算法,很经典的宽搜,注意细节即可
#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
#define x first
#define y second
typedef pair<int, int>PII;
int n, m;
int ans;
PII q[N * N];
char g[N][N];
bool st[N][N]
AcWing 1097 池塘计数
连通块问题,Flood Fill(洪水覆盖)算法,很经典的宽搜,注意细节即可
#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
#define x first
#define y second
typedef pair<int, int>PII;
int n, m;
int ans;
PII q[N * N];
char g[N][N];
bool st[N][N]