Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <string.h>
- #include <cstring>
- using namespace std;
- int main() {
- int n, m;
- int x, y;
- char s[1000][1000];
- int hor[10000], ver[10000];
- int all;
- int a[1000][1000];
- cin >> n >> m;
- for (int i = 1; i <= n; i++)
- for (int j = 1; j <= m; j++) {
- cin >> a[i][j];
- if (a[i][j] == '*')
- hor[i]++,
- ver[j]++,
- all++;
- }
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= m; j++) {
- if (a[i][j] == '*') {
- if (all == ver[j] + hor[i] - 1)
- cout << "YES" << endl;
- cout << i << " " << j;
- return 0;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment