Advertisement
Rofyda_Elghadban1

Untitled

Sep 23rd, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <algorithm>
  5. #include <cstdlib>
  6. #include <limits.h>
  7. #include <string>
  8.  
  9. #define ll long long
  10. #define pi 3.141592653
  11.  
  12. using namespace std;
  13. void Fast_IO();
  14. void Rofyda_Elghadban(){
  15. #ifndef ONLINE_JUDGE
  16. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  17. #endif
  18. }
  19.  
  20. /*ll gcd(ll num1,ll num2){
  21. while(num2!=0){
  22. ll temp=num1;
  23. num1=num2;
  24. num2=temp%num1;
  25. }
  26. return num1;
  27. }
  28.  
  29. ll lcm(ll num1,ll num2){
  30. return(num1/gcd(num1,num2))*num2;
  31. }*/
  32.  
  33. bool prime(ll n){
  34. if(n<2){
  35. return false;
  36. }for(ll i=2;i<=sqrt(n);i++){
  37. if(n%i==0){
  38. return false;
  39. }
  40. }return true;
  41. }
  42.  
  43.  
  44. int main()
  45. { Rofyda_Elghadban();
  46. //Fast_IO();
  47. //freopen("input.txt","r",stdin);
  48. //freopen("output.txt","r",stdout);
  49. ll t;
  50. cin>>t;
  51. while(t--){
  52. string s;
  53. cin>>s;
  54. ll counterR=0,counterG=0,counterB=0,counterW=0,counterY=0;
  55. for(ll i=0;i<s.size();i++){
  56. /*if(s[i]=='R'||s[i]=='G'||s[i]=='B'||s[i]=='W'||s[i]=='Y'){
  57. counter++;
  58. }*/if(s[i]=='R'){
  59. counterR++;
  60. }if(s[i]=='G'){
  61. counterG++;
  62. }if(s[i]=='B'){
  63. counterB++;
  64. }if(s[i]=='W'){
  65. counterW++;
  66. }if(s[i]=='Y'){
  67. counterY++;
  68. }else{
  69. continue;
  70. }
  71. }if(counterR==1&&counterG==1&&counterB==1&&counterW==1&&counterY==1){
  72. cout<<"YES"<<endl;
  73. }else{
  74. cout<<"NO"<<endl;
  75. }
  76. }
  77.  
  78.  
  79. return 0;
  80. }
  81.  
  82.  
  83.  
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement