-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathA_Doors_and_Keys.cpp
58 lines (53 loc) · 1.02 KB
/
A_Doors_and_Keys.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
56
57
58
#include <bits/stdc++.h>
#include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define int long long
#define ll long long
#define ld long double
#define mod 1000000007
#define PI 3.141592653589793238462
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(), x.end()
#define allg(x) x.begin(), x.end(), greater<int>()
#define sz(x) (int)x.size()
using namespace std;
bool isPowerOfTwo(int n)
{
if (n <= 0)
{
return false;
}
if (!(n & (n - 1)))
{
return true;
}
else
{
return false;
}
}
void solve()
{
string s;
cin >> s;
map<char, int> idx;
for (int i = 0; i < s.size(); i++)
idx[s[i]] = i;
if (idx['r'] < idx['R'] && idx['g'] < idx['G'] && idx['b'] < idx['B'])
cout << "YES\n";
else
cout << "NO\n";
}
int32_t main()
{
int t = 1;
cin >> t;
while (t--)
solve();
return 0;
}