-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtwobisop.cpp
55 lines (55 loc) · 878 Bytes
/
twobisop.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
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <map>
#include <set>
using namespace std;
typedef long long int ll;
int main()
{
int a[4];
ios_base::sync_with_stdio(false);
int t;
cin>>t;
bool flag;
string s[8];
while(t--){
flag=false;
//memset(a,0,sizeof(as));
int i,j;
for(i=0;i<8;i++)
cin>>s[i];
for(i=0;i<8;i++)
for(j=0;j<8;j++)
{
if(s[i][j]=='B')
{
if(flag){
a[2]=i;
a[3]=j;
break;
}
else{
a[0]=i;
a[1]=j;
flag=true;
}
}
}
//getline(cin,ka);
int check1,check2;
check1=a[2]-a[0];
check2=a[3]-a[1];
if((check1==check2)||(check1==(-1*check2)))
cout<<"Yes\n";
else
cout<<"No\n";
/*for(int i=0;i<8;i++){
for(int j=0;j<8;j++)
cout<<a[i][j]<<" ";
cout<<endl;
}*/
}
}