using namespace std; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include const int INFI=(1LL<<30)-100; const long long INFL=(1LL<<62)-100; const double eps=1e-10; const long double pi=acos(-1.0); const int MAXN=110; char a[MAXN][MAXN]; int ds[MAXN][MAXN]; int main(){ //freopen("date.in","r",stdin); //freopen("date.out","w",stdout); int n,m; scanf("%d%d",&n,&m); scanf("%*c"); for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ scanf("%c",&a[i][j]); } scanf("%*c"); } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(!ds[i][j]){ ds[i][j]=1; queue > q; q.push(make_pair(i,j)); int ve[2][2]={{1,0},{0,1}}; #define vi i+ve[t][0] #define vj j+ve[t][1] while(!q.empty()){ int i=q.front().first; int j=q.front().second; q.pop(); for(int t=0;t<2;t++){ if(a[vi][vj]=='.' && ds[vi][vj]