-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathA.cpp
39 lines (31 loc) · 819 Bytes
/
A.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
#include<bits/stdc++.h>
using namespace std;
using ll = long long int ;
int main(){
int testcases;
cin>>testcases;
while(testcases--)
{
string s;
cin>>s;
int check1r=0,check2r=0,check1g=0,check2g=0,check1b=0,check2b=0;
for (int i=0;i<6;i++)
{
if(s[i]=='R')
check1r=i;
if(s[i]=='r')
check2r=i;
if(s[i]=='G')
check1g=i;
if(s[i]=='g')
check2g=i;
if(s[i]=='B')
check1b=i;
if(s[i]=='b')
check2b=i;
}
if(check1r>check2r && check1g>check2g && check1b>check2b)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}}