fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int t,q;
  5. bool found;
  6. map<string, int> M;
  7. short int pos[7];//frnt, bak, lft, rigt, top , bottom
  8. cin >> t;
  9. M["black"]=1;
  10. M["blue"]=2;
  11. M["red"]=3;
  12. M["green"]=4;
  13. M["yellow"]=5;
  14. M["orange"]=6;
  15. //black=1, blue=2, red=3, green=4, yellow=5 ,orange=6
  16. while(t--){
  17. found=false;
  18. for(int i=0; i<6; i++){
  19. cin >> s;
  20. pos[i]=M[s];
  21. }
  22. q==0;
  23. for(int i=1; i<6; i++){
  24. if(pos[0]==pos[i]){
  25. q=i;i=5;
  26. }
  27. }
  28. if(q==5||q==0||q==4){found=false;}
  29. else{
  30. q++;
  31. while(q<5){
  32. if(pos[0]==pos[q]){found=true;}
  33. }
  34. }
  35. puts(found?"YES":"NO");
  36. }
  37. return 0;
  38. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
blue yellow green orange black green
green yellow green orange black green
compilation info
prog.cpp: In function 'int main()':
prog.cpp:19:20: error: 's' was not declared in this scope
             cin >> s;
                    ^
stdout
Standard output is empty