Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cmath>
- #include <algorithm>
- #include <cstdlib>
- #include <limits.h>
- #include <string>
- #define ll long long
- #define pi 3.141592653
- using namespace std;
- void Fast_IO();
- void Rofyda_Elghadban(){
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- /*ll gcd(ll num1,ll num2){
- while(num2!=0){
- ll temp=num1;
- num1=num2;
- num2=temp%num1;
- }
- return num1;
- }
- ll lcm(ll num1,ll num2){
- return(num1/gcd(num1,num2))*num2;
- }*/
- bool prime(ll n){
- if(n<2){
- return false;
- }for(ll i=2;i<=sqrt(n);i++){
- if(n%i==0){
- return false;
- }
- }return true;
- }
- int main()
- { Rofyda_Elghadban();
- //Fast_IO();
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","r",stdout);
- ll t;
- cin>>t;
- while(t--){
- string s;
- cin>>s;
- ll counterR=0,counterG=0,counterB=0,counterW=0,counterY=0;
- for(ll i=0;i<s.size();i++){
- /*if(s[i]=='R'||s[i]=='G'||s[i]=='B'||s[i]=='W'||s[i]=='Y'){
- counter++;
- }*/if(s[i]=='R'){
- counterR++;
- }if(s[i]=='G'){
- counterG++;
- }if(s[i]=='B'){
- counterB++;
- }if(s[i]=='W'){
- counterW++;
- }if(s[i]=='Y'){
- counterY++;
- }else{
- continue;
- }
- }if(counterR==1&&counterG==1&&counterB==1&&counterW==1&&counterY==1){
- cout<<"YES"<<endl;
- }else{
- cout<<"NO"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement