#include <stdio.h>
#include <string.h>
char s[101][101];
int main()
{
int n, i, j, x=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf(" %s",s[i]);
}
for(i=1;i<n-1;i++)
{
for(j=1;j<n-1;j++)
{
if(s[i][j]=='#'&&s[i-1][j]=='#'&&s[i+1][j]=='#'&&s[i][j-1]=='#'&&s[i][j+1]=='#')
{
s[i][j]='.';
s[i-1][j]='.';
s[i+1][j]='.';
s[i][j-1]='.';
s[i][j+1]='.';
}
}
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(s[i][j]=='#')
{
x=1;
break;
}
}
if(x)
break;
}
if(x)
printf("NO\n");
else
printf("YES\n");
return 0;
}
CF228B题Fox and Cross
最新推荐文章于 2024-10-04 23:00:36 发布