fork download
  1. #include <bits/stdc++.h>
  2. #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  3. #define bit(x,i) ((x >> i) & 1)
  4. #define offbit(x,i) x &= (~(1 << i))
  5. #define onbit(x,i) x |= 1 << (i)
  6. #define revbit(x,i) x^= (1 << i)
  7. #define countbit1(x) __builtin_popcount(x)
  8. #define counttail0(x) __builtin_ctz(x)
  9. #define countlead0(x) __builtin_clz(x)
  10. #define all(x) x.begin() , x.end()
  11. #define ii pair <int, int>
  12. #define MOD 1000000007
  13. #define el "\n"
  14. #define eb emplace_back
  15. #define pb push_back
  16. #define make_unique(x) sort(all(x));x.erase(unique(all(x)), x.end());
  17. #define PI 4*atan(1)
  18. using ld = long double;
  19. using ll = long long;
  20. using ull = unsigned long long;
  21. using namespace std;
  22. const ll inf = 1e18 + 5;
  23. const int dx4[4] = {-1, 0, 0, 1};
  24. const int dy4[4] = {0, -1, 1, 0};
  25. const int dx8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
  26. const int dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
  27. const int dx[8] = {-2,-2,-1,-1,1,1,2,2};
  28. const int dy[8] = {-1,1,-2,2,-2,2,-1,1};
  29. using vi = vector <int>;
  30. using vvi = vector <vi>;
  31. using vii = vector <ii>;
  32. mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
  33. long long Rand(long long l, long long h){
  34. assert(l <= h);
  35. return l + rd() * 1LL * rd() % (h - l + 1);
  36. }
  37. inline void solve(){
  38. // abc, acb, bac, bca, cab, cba
  39. string s;
  40. cin >> s;
  41. if( s== "abc" or s == "acb" or s == "bac" or s== "cba") cout << "YES\n";
  42. else cout << "NO\n";
  43. }
  44. const bool typetest = 1; // Test here
  45. signed main(){
  46. #ifndef ONLINE_JUDGE
  47. freopen("TASK.inp","r",stdin);
  48. freopen("TASK.out","w",stdout);
  49. #endif
  50. fast;
  51. int t(1);
  52. if (typetest) {
  53. cin >> t;
  54. // cin.ignore();
  55. }
  56. while (t--) {
  57. solve();
  58. }
  59. // cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  60. }
  61. // a + b = a^b + 2*(a&b), a + b = a|b + a&b, a^b = a|b - a&b
  62. // a^k mod m = a^(k mod (m-1)) mod m (m is prime)
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
NO