-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path001.hattrick.cpp
49 lines (46 loc) · 1.09 KB
/
001.hattrick.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
//hattrick - codechef(853)
/*
hattrick means we need to get continuous W .
So , we just checked all possibilities of it by checking whether a is 'W' then whether b is 'W' if c is also 'W' we store some variable g as 1,
in this way we check for all possibilities and finally output "YES" if g==1, otherwise "NO"
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--){
char a,b,c,d,e,f,g=0;
cin>>a>>b>>c>>d>>e>>f;
if(a=='W'){
if(b=='W'){
if(c=='W'){
g=1;
}
}
}
if(b=='W'){
if(c=='W'){
if(d=='W'){
g=1;
}
}
}
if(c=='W'){
if(d=='W'){
if(e=='W'){
g=1;
}
}
}
if(d=='W'){
if(e=='W'){
if(f=='W'){
g=1;
}
}
}
if(g==1)cout<<"YES\n";
else cout<<"NO\n";
}
}