fork download
  1. #include <bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define el endl
  5. using namespace std;
  6. void input()
  7. {
  8. if (fopen("in.txt", "r"))
  9. {
  10. freopen("in.txt", "r", stdin);
  11. freopen("out.txt", "w", stdout);
  12. }
  13. }
  14. int main()
  15. {
  16. Fast:
  17. input();
  18. //---------------------------------" " UPSOLVE---------------------------------------------------------------
  19.  
  20. int t;
  21. cin >> t;
  22.  
  23. while (t--)
  24. {
  25. string s;
  26. cin >> s;
  27. bool xst = false;
  28. for (int i = 0; i < s.size()-2; i++)
  29. {
  30. if ( (s[i]==1 && s[i+1]==0 && s[i+2]==1)
  31. || (s[i]==0 && s[i+1]==1 && s[i+2]==0) ) xst = true;
  32.  
  33.  
  34.  
  35. }
  36. if(xst = true)
  37. cout << "Good"<<el;
  38. else if(xst = false)
  39. cout << "Bad"<<el;
  40. }
  41.  
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty