-
Notifications
You must be signed in to change notification settings - Fork 0
/
699b.cpp
62 lines (62 loc) · 1.52 KB
/
699b.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include<stdio.h>
#include<string.h>
char maps[1010][1010];
int column[1010];
int row[1010];
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m))
{
memset(maps,0,sizeof(maps));
memset(column,0,sizeof(column));
memset(row,0,sizeof(row));
for(int i = 0; i < n; i++)
scanf("%s",maps[i]);
int count=0;
for(int i = 0; i < n; i++)
for(int j = 0; j < m; j++)
{
if(maps[i][j]=='*')
{
count++;
column[j]++;
row[i]++;
}
}
int flag=0;int x,y;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
{
if(maps[i][j]=='*')
{
if(count==column[j]+row[i]-1)
{
flag=1;
x=i;
y=j;
}
}
else
{
if(count==column[j]+row[i])
{
flag=1;
x=i;
y=j;
}
}
if(flag==1)break;
}
if(flag==1)break;
}
if(flag==1)
{
printf("YES\n");
printf("%d %d\n",x+1,y+1);
}
else printf("NO\n");
}
return 0;
}