malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   char buf[1 << 21], *p1 = buf, *p2 = buf;   inline long long read() {     long long ret = 0, ff = 1;     char ch = getchar();     while (!isdigit(ch)) {       if (ch ==  - ) ff = -ff;       ch = getchar();     }     while (isdigit(ch)) {       ret = (ret << 3) + (ret << 1) + ch -  0 ;       ch = getchar();     }     return ret * ff;   }   long long p, q, b;   long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }   inline long long ksm(long long a, long long b) {     long long res = 1, base = a;     while (b) {       if (b & 1) {         res = (res * base) % q;         if (res == 0) return 0;       }       base = (base * base) % q;       b >>= 1;     }     return res;   }   int main() {     int T = read();     while (T--) {       p = read(), q = read(), b = read();       long long g = gcd(p, q);       p /= g;       q /= g;       if (q == 1ll) {         printf( Finite n );       } else {         while (1) {           g = gcd(q, b);           if (g == 1) break;           while (q % g == 0) q /= g;           if (q == 1) break;         }         if (q == 1) {           printf( Finite n );         } else {           printf( Infinite n );         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     cin.tie(0)->sync_with_stdio(0);     int n;     cin >> n;     vector<vector<int>> adj(n);     for (int i = 1; i < n; ++i) {       int u, v;       cin >> u >> v, --u, --v;       adj[u].push_back(v), adj[v].push_back(u);     }     array<int, 2> cnt{};     function<void(int, int, int)> dfs = [&](int u, int p, int c) {       ++cnt[c];       for (auto v : adj[u]) {         if (v != p) {           dfs(v, u, !c);         }       }     };     dfs(0, 0, 0);     cout << min(cnt[0], cnt[1]) - 1 <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int fact[100010];   long long int ifact[100010];   long long int ncr(int n, int r) {     if (r < 0 || n < 0) return 0;     return (fact[n] * ifact[n - r] % 1000000007) * ifact[r] % 1000000007;   }   int A[10];   long long int dp[11][101];   int main() {     fact[0] = 1;     for (int i = 1; i < 100010; i++) fact[i] = (fact[i - 1] * i) % 1000000007;     ifact[0] = ifact[1] = 1;     for (int i = 2; i < 100010; i++)       ifact[i] =           (1000000007 - (1000000007 / i) * ifact[1000000007 % i] % 1000000007) %           1000000007;     for (int i = 1; i < 100010; i++)       ifact[i] = (ifact[i - 1] * ifact[i]) % 1000000007;     int N;     cin >> N;     for (int i = 0; i < 10; i++) cin >> A[i];     dp[10][0] = 1;     for (int i = 9; i >= 0; i--)       for (int j = A[i]; j <= N; j++)         for (int k = A[i]; k <= j; k++) {           int rem = (j - k) + (i > 0 ? 1 : 0);           int n = k, r = rem;           dp[i][j] =               (dp[i][j] + ncr(n + r - 1, r - 1) * dp[i + 1][j - k]) % 1000000007;         }     long long int total = 0;     for (int i = 1; i <= N; i++) total = (total + dp[0][i]) % 1000000007;     cout << total << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n >> m;     if (n == 1 && m == 1)       cout << 1;     else if (m + n < 5)       cout << -1;     else {       int x = n * m / 2 + 1, y = 1;       for (int i = 0; i < n; i++) {         for (int j = 0; j < m; j++) {           if ((i + j) % 2 == 0) {             cout << x <<    ;             x++;           } else {             cout << y <<    ;             y++;           }         }         cout << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename G>   struct triple {     G first, second, T;   };   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long d, n, m;     cin >> d >> n >> m;     vector<pair<long long, long long> > x(m + 2);     x[m + 1].first = d;     for (int i = 1; i <= m; i++) cin >> x[i].first >> x[i].second;     sort(x.begin(), x.end());     vector<int> mn(m + 2);     stack<int> s;     for (int i = m + 1; i >= 0; i--) {       while (!s.empty() && x[s.top()].second > x[i].second) s.pop();       if (!s.empty())         mn[i] = s.top();       else         mn[i] = m + 2;       s.push(i);     }     long long comb = n, ans = 0;     for (int i = 0; i < m + 1; i++) {       int p = mn[i];       long long t = min(n - comb, max(x[p].first - x[i].first - comb, 0LL));       ans += x[i].second * t;       comb += t;       comb -= x[i + 1].first - x[i].first;       if (comb < 0) {         cout <<  -1 n ;         return 0;       }     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void run() {     vector<string> v;     for (int i = 0; i < 8; i++) {       string s;       cin >> s;       v.push_back(s);     }     int a = INT_MAX, b = INT_MAX;     for (int i = 0; i < 8; i++) {       int c = 0;       for (int j = 7; j >= 0; j--) {         if (v[j][i] ==  B ) {           b = min(b, c);           break;         } else if (v[j][i] ==  W )           break;         c++;       }     }     for (int i = 0; i < 8; i++) {       int c = 0;       for (int j = 0; j < 8; j++) {         if (v[j][i] ==  W ) {           a = min(a, c);           break;         } else if (v[j][i] ==  B )           break;         c++;       }     }     if (a <= b)       cout <<  A ;     else       cout <<  B ;     return;   }   int main() {     run();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k;   struct Lesson {     long long a, b;     int c, id;     bool operator<(const Lesson &t) const { return c < t.c; }   } ls[55];   int fstc[110];   long long dp[55][55][110];   pair<int, int> trans[55][55][110];   inline void upd(int x1, int y1, int z1, int y2, int z2, long long val) {     if (dp[x1][y1][z1] < val) {       dp[x1][y1][z1] = val;       trans[x1][y1][z1] = make_pair(y2, z2);     }   }   void Print(int lvl, int od, int ad) {     if (lvl == 0) {       printf( %d %I64d n , ls[od].id, ls[od].a + ad);       return;     }     Print(lvl - 1, trans[lvl][od][ad].first, trans[lvl][od][ad].second);     printf( %d %lld n , ls[od].id, ls[od].a + ad);   }   int main() {     scanf( %d%d%d , &n, &m, &k);     for (int i = 0; i < m; i++) {       scanf( %I64d%I64d%d , &ls[i].a, &ls[i].b, &ls[i].c);       ls[i].id = i + 1;     }     sort(ls, ls + m);     memset(fstc, -1, sizeof(fstc));     for (int i = 0; i < m; i++)       if (fstc[ls[i].c] == -1) fstc[ls[i].c] = i;     for (int i = 0; i < m; i++) {       for (int j = 0; j <= (int)(ls[i].b - ls[i].a); j++) {         dp[0][i][j] = (ls[i].a + j);       }     }     for (int i = 1; i < n; i++) {       for (int j = 0; j < m; j++) {         int c = ls[j].c;         for (int task = 0; task <= 100; task++)           if (dp[i - 1][j][task]) {             long long val = ls[j].a + task;             if (val > ls[j].b) continue;             long long knval = val * 1ll * k;             long long nvalk = val + 1ll * k;             for (int nc = c + 1; nc <= 100; nc++) {               if (fstc[nc] == -1) continue;               for (int nj = fstc[nc]; nj < m && ls[nj].c == nc; nj++) {                 if (ls[nj].a <= knval && knval <= ls[nj].b) {                   int ntask = (int)(knval - ls[nj].a);                   upd(i, nj, ntask, j, task, dp[i - 1][j][task] + knval);                 }                 if (ls[nj].a <= nvalk && nvalk <= ls[nj].b) {                   int ntask = (int)(nvalk - ls[nj].a);                   upd(i, nj, ntask, j, task, dp[i - 1][j][task] + nvalk);                 }               }             }           }       }     }     long long ans = 0;     int y = -1, z = -1;     for (int i = 0; i < m; i++)       for (int j = 0; j <= (int)(ls[i].b - ls[i].a); j++) {         if (dp[n - 1][i][j] > ans) {           ans = dp[n - 1][i][j];           y = i;           z = j;         }       }     if (ans == 0 || y == -1 || z == -1) {       printf( NO n );       return 0;     }     printf( YES n );     Print(n - 1, y, z);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int Rand(int x) { return rand() * rand() % x + 1; }   const int INF = 0x3f3f3f3f, N = 5000005, M = 2000005, MOD = 1e9 + 7;   long long qpow(long long a, long long b) {     long long ret = 1;     for (; b; b >>= 1, a = a * a % MOD)       if (b & 1) ret = ret * a % MOD;     return ret;   }   long long val[N];   map<int, int> g[N];   map<long long, int> has;   int find(int id, int x) {     if (x == g[id][x]) return x;     return g[id][x] = find(id, g[id][x]);   }   void Union(int id, int x, int y) {     int fx = find(id, x), fy = find(id, y);     if (fx == fy) return;     g[id][fy] = fx;   }   int cnt[N], ss;   int main() {     ios::sync_with_stdio(false);     cin.tie(0), cout.tie(0);     int n, m, c;     cin >> n >> m >> c;     for (int i = 1; i <= n; i++) cin >> val[i];     long long ans = qpow(2, c) * qpow(2, n) % MOD;     for (int i = 1; i <= m; i++) {       int u, v;       cin >> u >> v;       long long x = val[u] ^ val[v];       if (!has.count(x)) has[x] = ++ss, cnt[ss] = n;       x = has[x];       if (!g[x][u]) g[x][u] = u;       if (!g[x][v]) g[x][v] = v;       if (find(x, u) == find(x, v)) continue;       Union(x, u, v);       ans = (ans - qpow(2, cnt[x]) + MOD) % MOD;       cnt[x]--;       ans = (ans + qpow(2, cnt[x]) + MOD) % MOD;     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, minx, h, m, ans;     int a[105];     cin >> n >> minx;     for (int i = 1; i <= n; i++) {       cin >> h >> m;       a[i] = h * 60 + m;     }     if (a[1] >= minx + 1) {       cout << 0 <<     << 0 << endl;       return 0;     }     for (int i = 2; i <= n; i++) {       if (a[i] - a[i - 1] >= minx * 2 + 2) {         ans = a[i - 1] + minx + 1;         cout << ans / 60 <<     << ans % 60 << endl;         return 0;       }     }     ans = a[n] + minx + 1;     cout << ans / 60 <<     << ans % 60 << endl;     return 0;   }
#include <bits/stdc++.h>   const double eps = 1e-10, pi = acos(-1.0);   const int maxS = 1e2 + 10;   const int maxS2 = 5e4 + 10;   const unsigned long long MOD = 1e9 + 7;   using namespace std;   struct point {     int x, y, z;   };   int n, m, i, j, k, x, y, z, T, ii, t, l, r, pos;   int tot = 0, cnt = 0, ans = 0, sum = 0;   bool chk, chk2[maxS], flag;   string s, s1, s2;   char c[maxS][maxS];   vector<point> res;   void print(int x, int y, int l) {     int i;     for (i = x - l; i <= x + l; i++) c[i][y] =  # ;     for (i = y - l; i <= y + l; i++) c[x][i] =  # ;   }   bool deal(int x, int y, int l) {     int i;     if (x - l < 0 || x + l >= n || y - l < 0 || y + l >= m) return false;     for (i = x - l; i <= x + l; i++)       if (c[i][y] ==  . ) return false;     for (i = y - l; i <= y + l; i++)       if (c[x][i] ==  . ) return false;     print(x, y, l);     res.push_back({x, y, l});     chk = true;     return true;   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> m;     for (i = 0; i < n; i++)       for (j = 0; j < m; j++) cin >> c[i][j];     for (i = 0; i < n; i++)       for (j = 0; j < m; j++)         if (c[i][j] ==  * ) {           chk = false;           for (k = 1; k < min(n, m); k++)             if (deal(i, j, k)) break;           if (!chk)             for (k = 1; k < min(n, m); k++)               if (deal(i + k, j, k)) break;           if (!chk)             for (k = 1; k < min(n, m); k++)               if (deal(i - k, j, k)) break;           if (!chk)             for (k = 1; k < min(n, m); k++)               if (deal(i, j + k, k)) break;           if (!chk)             for (k = 1; k < min(n, m); k++)               if (deal(i, j - k, k)) break;         }     chk = true;     for (i = 0; i < n; i++)       for (j = 0; j < m; j++)         if (c[i][j] ==  * ) chk = false;     if (!chk)       cout << -1 << endl;     else {       cout << res.size() << endl;       for (i = 0; i < res.size(); i++)         cout << res[i].x + 1 <<     << res[i].y + 1 <<     << res[i].z << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline int read() {     int x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   bool b[1000000 + 5];   int Q, last[1000000 + 5], s[1000000 / 5 + 5], num, p[1000000 * 2 + 5],       inv[1000000 * 2 + 5], a[65], c[65], ans, f[8][8], sum[25];   inline int C(int n, int m) {     return m > n || m < 0                ? 0                : 1LL * p[n] * inv[m] % 1000000007 * inv[n - m] % 1000000007;   }   inline int S(int n, int m) { return m ? C(n + m - 1, m - 1) : (n ? 0 : 1); }   int main() {     p[0] = p[1] = inv[0] = inv[1] = sum[0] = 1;     for (int i = 2; i <= 1000000; ++i) {       if (!b[i]) s[++num] = i, last[i] = i;       for (int j = 1; s[j] * i <= 1000000; ++j) {         b[s[j] * i] = 1;         last[s[j] * i] = s[j];         if (i % s[j] == 0) break;       }     }     for (int i = 2; i <= 1000000 * 2; ++i)       p[i] = 1LL * p[i - 1] * i % 1000000007,       inv[i] =           1LL * (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;     for (int i = 2; i <= 1000000 * 2; ++i)       inv[i] = 1LL * inv[i - 1] * inv[i] % 1000000007;     for (Q = read(); Q--;) {       int m = read(), n = read();       num = ans = 0;       while (n > 1) {         ++num;         c[num] = 0;         a[num] = last[n];         for (int t = last[n]; n % t == 0; n /= t) ++c[num];       }       for (int i = 1; i <= 20; ++i) sum[i] = (sum[i - 1] + S(i, m)) % 1000000007;       memset(f, 0, sizeof(f));       f[0][0] = 1;       for (int i = 1; i <= num; ++i)         for (int j = 0; j < i; ++j) {           f[i][j] = (f[i][j] + 1LL * f[i - 1][j] * S(c[i], m)) % 1000000007;           f[i][j + 1] =               (f[i][j + 1] + 1LL * f[i - 1][j] * sum[c[i] - 1]) % 1000000007;         }       for (int i = 0; i <= num; ++i)         ans = (ans + 1LL * (1 << i) * f[num][i]) % 1000000007;       printf( %d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int oo = 1e9;   const int maxc = 77;   struct thang {     int X, B;   };   thang A[1010];   double f[1010];   int trace[1010], st[1010];   int N, L;   void nhap() {     scanf( %d%d , &N, &L);     for (int i = 1; i <= N; i++) scanf( %d%d , &A[i].X, &A[i].B);     A[0].X = 0;   }   void solve(double mid) {     for (int i = 1; i <= N; i++) f[i] = oo;     f[0] = 0;     for (int i = 1; i <= N; i++) {       int vt = 0;       double t = oo;       for (int j = i - 1; j >= 0; j--)         if (f[j] + sqrt(abs((A[i].X - A[j].X) - L * 1.0)) - mid * 1.0 * A[i].B <             t) {           vt = j;           t = f[j] + sqrt(abs((A[i].X - A[j].X) - L * 1.0)) - mid * 1.0 * A[i].B;         }       f[i] = t;       trace[i] = vt;     }   }   void chat() {     double l = 0, r = oo;     for (int i = 1; i <= maxc; i++) {       double mid = (l + r) / 2;       solve(mid);       if (f[N] <= 0)         r = mid;       else         l = mid;     }     int top = 0, i = N;     while (i != 0) {       st[++top] = i;       i = trace[i];     }     while (top > 0) printf( %d  , st[top--]);   }   int main() {     nhap();     chat();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, a[300005], op, l, r;   long long fib[300005 + 100];   struct wyh {     long long tagl, tagr, sum;   } tree[300005 * 4];   inline long long getint() {     long long x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) x = x * 10 + ch -  0 , ch = getchar();     return x * f;   }   inline void update(int x) {     tree[x].sum = tree[x * 2].sum + tree[x * 2 + 1].sum;     if (tree[x].sum >= 1000000009) tree[x].sum %= 1000000009;   }   inline void build(int x, int l, int r) {     if (l == r) {       tree[x].sum = a[l];       return;     }     int mid = (l + r) >> 1;     build(x * 2, l, mid), build(x * 2 + 1, mid + 1, r);     update(x);   }   inline void modify(int x, int l, int r, int s, int t, int c, int d);   inline void push(int x, int l, int r) {     if (tree[x].tagl || tree[x].tagr) {       int mid = (l + r) >> 1;       modify(x * 2, l, mid, l, r, tree[x].tagl, tree[x].tagr);       modify(x * 2 + 1, mid + 1, r, l, r, tree[x].tagl, tree[x].tagr);       tree[x].tagl = tree[x].tagr = 0;     }   }   inline long long get(int a, int b, int x) {     if (x == 0) return a;     if (x == 1) return b;     return (a * fib[x - 1] % 1000000009 + b * fib[x] % 1000000009) % 1000000009;   }   inline void modify(int x, int l, int r, int s, int t, int c, int d) {     if (s <= l && t >= r) {       int first, second;       first = get(c, d, l - s), second = get(c, d, l - s + 1);       c = first, d = second;       tree[x].tagl += c, tree[x].tagr += d;       tree[x].tagl %= 1000000009, tree[x].tagr %= 1000000009;       tree[x].sum = (tree[x].sum + get(c, d, r - l + 2) - d) % 1000000009;       return;     }     push(x, l, r);     int mid = (l + r) >> 1;     if (s <= mid) modify(x * 2, l, mid, s, t, c, d);     if (t > mid) modify(x * 2 + 1, mid + 1, r, s, t, c, d);     update(x);   }   inline long long query(int x, int l, int r, int s, int t) {     if (s <= l && t >= r) return tree[x].sum;     int mid = (l + r) >> 1;     push(x, l, r);     long long tmp = 0;     if (s <= mid) tmp += query(x * 2, l, mid, s, t);     if (t > mid) tmp += query(x * 2 + 1, mid + 1, r, s, t);     return tmp;   }   void work() {     n = getint(), m = getint();     for (int i = 1; i <= n; ++i) a[i] = getint();     fib[1] = 1;     for (int i = 2; i <= n + 5; ++i)       fib[i] = (fib[i - 1] + fib[i - 2]) % 1000000009;     build(1, 1, n);     for (int i = 1; i <= m; ++i) {       op = getint(), l = getint(), r = getint();       if (op == 1)         modify(1, 1, n, l, r, 1, 1);       else         printf( %I64d n ,                (query(1, 1, n, l, r) % 1000000009 + 1000000009) % 1000000009);     }   }   int main() {     work();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   long long size(const T& x) {     return x.size();   }   #pragma GCC optimize( Ofast )   template <class T>   T smod(T a, T b) {     return (a % b + b) % b;   }   long long pw(long long a, long long b) {     long long res = 1;     while (b > 0) {       if (b % 2) res = (res * a) % 1000000007;       b /= 2;       a = a * a % 1000000007;     }     return res;   }   void solve() {     long long n;     cin >> n;     string S;     cin >> S;     long long cntk = 0;     for (long long i = (0); i < (n); ++i) cntk += (S[i] ==  ? );     vector<long long> A(n);     A[0] = (S[0] ==  a );     for (long long i = (1); i < (n); ++i) A[i] = A[i - 1] + (S[i] ==  a );     vector<long long> C(n);     C[n - 1] = (S[n - 1] ==  c );     for (long long i = (n - 2); i > -1; --i) C[i] = C[i + 1] + (S[i] ==  c );     vector<long long> KL(n);     KL[0] = (S[0] ==  ? );     for (long long i = (1); i < (n); ++i) KL[i] = KL[i - 1] + (S[i] ==  ? );     vector<long long> KR(n);     KR[n - 1] = (S[n - 1] ==  ? );     for (long long i = (n - 2); i > -1; --i) KR[i] = KR[i + 1] + (S[i] ==  ? );     long long ans = 0;     for (long long i = (1); i < (n - 1); ++i) {       if (S[i] ==  a  || S[i] ==  c ) continue;       long long cnta = A[i - 1];       long long cntc = C[i + 1];       long long cntkl = KL[i - 1];       long long cntkr = KR[i + 1];       long long isk = (S[i] ==  ? );       ans = (ans + cnta * cntc * pw(3, cntk - isk)) % 1000000007;       ans = (ans + cnta * cntkr * pw(3, cntk - 1 - isk)) % 1000000007;       ans = (ans + cntkl * cntc * pw(3, cntk - 1 - isk)) % 1000000007;       ans = (ans + cntkl * cntkr * pw(3, cntk - 2 - isk)) % 1000000007;     }     cout << ans << endl;   }   int main() {     cin.sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 100010;   int p[maxn], w[maxn];   vector<pair<pair<int, int>, int>> a;   int find(int x) {     if (p[x] == x)       return x;     else {       int ret = find(p[x]);       w[x] ^= w[p[x]];       return p[x] = ret;     }   }   int main() {     int l, r, n;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> l >> r;       a.push_back(make_pair(make_pair(l, 0), i));       a.push_back(make_pair(make_pair(r, 1), i));     }     sort(a.begin(), a.end());     for (int i = 0; i < n; i++) p[i] = i;     for (int i = 0; i < a.size(); i += 2)       if (a[i].second != a[i + 1].second) {         int ret = a[i].first.second == a[i + 1].first.second;         int u = a[i].second, v = a[i + 1].second;         if (find(u) == find(v)) {           if (w[u] ^ w[v] ^ ret) {             cout << -1 << endl;             return 0;           }         } else {           w[p[v]] = ret ^ w[v];           p[p[v]] = u;         }       }     for (int i = 0; i < n; i++) {       find(i);       cout << w[i] <<    ;     }     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double dis(double ax, double ay, double bx, double by) {     return sqrt(pow(ax - bx, 2) + pow(ay - by, 2));   }   bool f(double a, double b, double c) {     if (a == sqrt(pow(b, 2) + pow(c, 2)))       return true;     else       return false;   }   int main() {     cout << fixed << setprecision(15);     double ax, ay, bx, by, cx, cy;     cin >> ax >> ay >> bx >> by >> cx >> cy;     double ab = dis(ax, ay, bx, by), bc = dis(bx, by, cx, cy),            ac = dis(ax, ay, cx, cy);     bool res = true;     if (ab == bc) {       if (ay - by == 0) {         if (ay == by && ay == cy) res = false;       } else if (ax - bx == 0) {         if (ax == bx && ax == cx) res = false;       } else {         double m = (ay - by) / (ax - bx);         if (cy == (m * cx + ay - m * ax)) res = false;       }     } else       res = false;     if (res)       cout <<  Yes  << endl;     else       cout <<  No  << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int w = 26;     int count = 0;     char a[] = { a ,  b ,  c ,  d ,  e ,  f ,  g ,  h ,  i ,  j ,  k ,  l ,  m ,                  n ,  o ,  p ,  q ,  r ,  s ,  t ,  u ,  v ,  w ,  x ,  y ,  z };     string b;     cin >> b;     for (char c : b) {       for (int m = 0; m < w; m++) {         if (c == a[m]) {           a[m] =  1 ;           count++;         }       }     }     if (count % 2 == 0) {       cout <<  CHAT WITH HER! ;     } else {       cout <<  IGNORE HIM! ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s, x;     cin >> s;     int count = 0, sz = s.size();     for (int i = 0; i < sz; ++i)       if (s[i] ==  1 ) ++count;     for (int i = 0; i < sz; ++i) {       if (s[i] ==  0 )         x +=  0 ;       else if (s[i] ==  2 ) {         while (count-- > 0) x +=  1 ;         x +=  2 ;       }     }     while (count-- > 0) x +=  1 ;     cout << x;     return (0);   }