Advertisement
albnayem

Untitled

Apr 29th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. char edge[100][100];
  2. int main()
  3. {
  4. //seive();
  5. //freopen("Nayem.txt", "r", stdin);
  6. Fast_read
  7.  
  8. ll n;
  9. cin>>n;
  10.  
  11. for (int i=0;i<n;i++)
  12. {
  13. for (int j=0;j<n;j++)
  14. {
  15. cin>>edge[i][j];
  16. }
  17. }
  18.  
  19. for (int i=1;i<n-1;i++)
  20. {
  21. for (int j=1;j<n-1;j++)
  22. {
  23. if (edge[i][j]=='.' && edge[i-1][j]=='.' && edge[i+1][j]=='.' && edge[i][j-1]=='.' && edge[i][j+1]=='.')
  24. {
  25. edge[i][j]='#';
  26. edge[i+1][j]='#';
  27. edge[i-1][j]='#';
  28. edge[i][j+1]='#';
  29. edge[i][j-1]='#';
  30. }
  31. }
  32. }
  33.  
  34. for (int i=0;i<n;i++)
  35. {
  36. for (int j=0;j<n;j++)
  37. {
  38. if (edge[i][j]=='.')
  39. {
  40. cout<<"NO"<<endl;
  41. return 0;
  42. }
  43. }
  44. }
  45.  
  46. cout<<"YES"<<endl;
  47.  
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement