fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios_base::sync_with_stdio(false); cin.tie(nullptr);
  7. int n , m; cin >> n >> m;
  8. char arr[n+2][m+2] = {};
  9. for (int i = 1; i <= n; i++)
  10. {
  11. for (int j = 1; j <= m; j++)
  12. {
  13. cin >> arr[i][j];
  14. }
  15.  
  16. }
  17. int x,y; cin >> x >> y;
  18. if(arr[x-1][y] == '.' || arr[x-1][y-1] == '.' || arr[x][y-1] == '.' || arr[x+1][y] == '.' || arr[x+1][y-1] == '.' || arr[x+1][y+1] == '.' || arr[x][y+1] == '.' || arr[x+1][y] == '.' || arr[x-1][y+1] == '.')
  19. {
  20. cout << "no";
  21. }
  22. else
  23. {
  24. cout << "yes";
  25. }
  26.  
  27.  
  28. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
yes