Created
October 15, 2016 03:09
-
-
Save harrypotter0/c39f0bdfbf735cdffda22bcb86ca83cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
char A[101][101],i,j; int s,n; | |
int main(){ | |
scanf("%d",&n); | |
for(i=1;i<=n;i++) | |
scanf("%s",A[i] + 1); | |
for(i=1;i<=n;i++) | |
for(j=1;j<=n;j++) | |
if(A[i][j] == '#' && A[i][j+1] == '#' && A[i+1][j] == '#' && A[i][j-1] == '#' && A[i-1][j] == '#') | |
A[i][j] = A[i][j+1] = A[i+1][j] = A[i][j+1] = A[i+1][j] = 0, s += 5; | |
else if(A[i][j] == '.') s++; | |
printf(s == n * n ? "YES" : "NO"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment