//http://codeforces.com/problemset/problem/699/B
#include <stdio.h>
#include <string>
#include <cstring>
#include <queue>
#include <algorithm>
#include <functional>
#include <vector>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <iostream>
#include <sstream>
#include <time.h>
#include <stack>
#include <set>
#include <map>
#include <time.h>
#include <list>
#include <bitset>
using namespace std;
const int MAX=1005;
char G[MAX][MAX];
int X[MAX]={0},Y[MAX]={0};
int N,M,Sum=0;
int main()
{
cin.sync_with_stdio(false);
cin>>N>>M;
for (int i=0;i<N;i++)
cin>>G[i];
for (int i=0;i<N;i++)
for (int j=0;j<M;j++)
if (G[i][j]=='*')
X[i]++,Y[j]++,Sum++;
bool ok=false;
int x,y;
for (int i=0;i<N;i++)
for (int j=0;j<M;j++)
if (X[i]+Y[j]-(G[i][j]=='*')==Sum)
ok=true,x=i+1,y=j+1,i=N,j=M;
if (ok)
cout<<"YES\n"<<x<<' '<<y;
else
cout<<"NO";
return 0;
}
CodeForces 699B - One Bomb 暴力
最新推荐文章于 2018-01-30 23:15:05 发布