Saleh127

codeforces 1150B.cpp

May 29th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define pi acos(-1)
  6. int main()
  7. {
  8. char a[100][100];
  9. ll i,j,k,l;
  10. cin>>l;
  11. for(i=1;i<=l;i++)
  12. {
  13. for(j=1;j<=l;j++)
  14. {
  15. cin>>a[i][j];
  16. }
  17. }
  18. for(i=1;i<=l;i++)
  19. {
  20. for(j=1;j<=l;j++)
  21. {
  22. if(a[i][j]=='.' && a[i+1][j]=='.' && a[i][j+1]=='.' && a[i][j-1]=='.' && a[i-1][j]=='.')
  23. {
  24. a[i][j]='#' , a[i+1][j]='#',a[i][j+1]='#',a[i][j-1]='#', a[i-1][j]='#';
  25. }
  26. }
  27. }
  28. for(i=1;i<=l;i++)
  29. {
  30. for(j=1;j<=l;j++)
  31. {
  32. if(a[i][j]=='.')
  33. {
  34. printf("NO\n");
  35. return 0;
  36. }
  37. }
  38. }
  39. printf("YES\n");
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment