-
Notifications
You must be signed in to change notification settings - Fork 1
/
CHEFROUT
57 lines (49 loc) · 997 Bytes
/
CHEFROUT
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
#include <iostream>
using namespace std;
int main()
{
int t,j,i;
cin>>t;
while(t--){
string s;
char c[100000];
cin>>s;
c[0] = s[0];
j=1;
for(i=1; i < s.length(); i++)
{
if(s[i]!=s[i-1])
{
c[j] = s[i];
j++;
}
}
int flag = 0;
//for(i = 0; i < j; i++)
// cout<<c[i]<<" ";
//cout<<endl;
for(i = 0; i < j-1; i++)
{
if(c[i]=='E' && c[i+1]=='C')
{
flag=1;
break;
}
else if(c[i]=='S' && c[i+1]=='E')
{
flag=1;
break;
}
else if(c[i]=='S' && c[i+1]=='C')
{
flag=1;
break;
}
}
if(flag==1)
cout<<"no"<<endl;
else
cout<<"yes"<<endl;
}
return 0;
}