askarulytarlan

Untitled

Jan 10th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <string.h>
  4. #include <cstring>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. int n, m;
  10. int x, y;
  11. char s[1000][1000];
  12. int hor[10000], ver[10000];
  13. int all;
  14. int a[1000][1000];
  15. cin >> n >> m;
  16.  
  17. for (int i = 1; i <= n; i++)
  18. for (int j = 1; j <= m; j++) {
  19. cin >> a[i][j];
  20. if (a[i][j] == '*')
  21. hor[i]++,
  22. ver[j]++,
  23. all++;
  24. }
  25.  
  26. for (int i = 1; i <= n; i++) {
  27. for (int j = 1; j <= m; j++) {
  28. if (a[i][j] == '*') {
  29. if (all == ver[j] + hor[i] - 1)
  30. cout << "YES" << endl;
  31. cout << i << " " << j;
  32. return 0;
  33. }
  34. }
  35. }
  36. }
Add Comment
Please, Sign In to add comment