malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int MAX = 300010;   int n;   int maxx;   int node[2 * MAX][30];   int cau[MAX];   int site;   int other;   void in() {     scanf( %d , &n);     int a, b;     char c;     for (int i = 1; i < n; i++) {       scanf( %d %d %c , &a, &b, &c), node[a][c -  a ] = b;     }   }   int w = 1;   int mix(int x, int y) {     if (x == 0 || y == 0) return x + y;     int now = ++other;     site++;     for (int i = 0; i < 26; i++) node[now][i] = mix(node[x][i], node[y][i]);     return now;   }   void dfs(int x, int deep) {     other = n + 1;     int now = other;     site = 0;     for (int i = 0; i < 26; i++) now = mix(now, node[x][i]);     cau[deep] += site;     for (int i = 0; i < 26; i++)       if (node[x][i] > 0) dfs(node[x][i], deep + 1);   }   void work() {     dfs(1, 1);     maxx = 1;     for (int i = 1; i <= n; i++)       if (n - cau[maxx] > n - cau[i]) maxx = i;   }   void out() {     printf( %d n , n - cau[maxx]);     printf( %d n , maxx);   }   int main() {     in();     work();     out();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int tmw168 = 1e5;   long long a, b, p, q, invp;   long long gcd(long long x, long long y) {     if (y == 0) return x;     return gcd(y, x % y);   }   long long test(long long r) {     r = r * invp % q;     r += a / q * q;     if (r < a) r += q;     return r;   }   int f(long long x, long long y) {     if (min(x, y) > b) return false;     cout << min(x, y) <<   n ;     return true;   }   long long inv(long long a, long long b) {     long long s = 0, t = 1;     long long old_s = 1, old_t = 0;     long long r = b, old_r = a;     while (r != 0) {       long long quotient = old_r / r;       long long tr = r;       r = old_r - quotient * r;       old_r = tr;       long long ts = s;       s = old_s - quotient * s;       old_s = ts;       long long tt = t;       t = old_t - quotient * t;       old_t = tt;     }     old_s = (old_s % q + q) % q;     return old_s;   }   void solve() {     cin >> a >> b >> p >> q;     long long g = gcd(p, q);     p /= g;     q /= g;     p %= q;     int ma = -1, gd = 0;     if (b - a < tmw168) {       for (int i = a; i <= b; i++) {         int cur = min(i * p % q, q - i * p % q);         if (cur > ma) {           ma = cur;           gd = i;         }       }       cout << gd <<   n ;       return;     }     invp = inv(p, q);     for (int i = 0; i < q; i++) {       if (f(test(q / 2 - i), test((q + 1) / 2 + i))) return;     }   }   int main() {     ios::sync_with_stdio(false);     int t;     cin >> t;     while (t--) solve();   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n, pos;     string s;     cin >> n >> s;     bool flag = false;     for (int i = 1; i < n; i++) {       if (s[i] == s[i - 1])         continue;       else {         flag = true;         pos = i;         break;       }     }     if (flag)       cout <<  YES  << endl, cout << s[pos - 1] << s[pos] << endl;     else       cout <<  NO  << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int Z = 3 * (int)1e3 + 111;   const int N = 3 * (int)1e5 + 111;   const int INF = (int)1e9 + 111;   const int MOD = (int)1e9 + 7;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     double l, d, v, g, r;     cin >> l >> d >> v >> g >> r;     double t(0);     t = d / v;     if (int(t + 1) % int(g + r) <= g) {       if (int(t) % int(g + r) >= g) t = int(t) + 1;     } else {       t += (g + r) - int(t);     }     t += (l - d) / v;     cout << setprecision(20) << t;   }
#include <bits/stdc++.h>   using namespace std;   int N, ANS, X[201], Y[201];   char S[205];   int main() {     scanf( %d %s , &N, S);     for (int i = 0; i < N; i++) {       X[i + 1] += X[i], Y[i + 1] += Y[i];       char c = S[i];       if (c ==  U ) Y[i + 1]++;       if (c ==  R ) X[i + 1]++;       if (c ==  D ) Y[i + 1]--;       if (c ==  L ) X[i + 1]--;     }     for (int i = 1; i <= N; i++)       for (int j = i; j <= N; j++)         ANS += (X[j] - X[i - 1] == 0 && Y[j] - Y[i - 1] == 0);     printf( %d n , ANS);   }
#include <bits/stdc++.h>   using namespace std;   const double PI = acos(-1.0);   const double EPS = 1e-9;   const int N = (1 << 15);   const int OO = 200000;   struct edge {     int from, to, w;     edge(int from, int to, int w) : from(from), to(to), w(w) {}     bool operator<(const edge& e) const { return w < e.w; }   };   struct UnionFind {     vector<int> rank, parent;     int forests;     UnionFind(int n) {       rank = vector<int>(n);       parent = vector<int>(n);       int forests = n;       for (int i = 0; i < n; i++) parent[i] = i, rank[i] = 1;     }     int find_set(int x) {       if (x == parent[x]) return x;       return parent[x] = find_set(parent[x]);     }     void link(int x, int y) {       if (rank[x] > rank[y]) swap(x, y);       parent[x] = y;       rank[y] += rank[x];     }     bool union_sets(int x, int y) {       x = find_set(x), y = find_set(y);       if (x != y) {         link(x, y);         forests--;       }       return x != y;     }     long long same_set(int x, int y) {       x = find_set(x), y = find_set(y);       if (x == y) return 0;       long long t = (long long)rank[x] * rank[y];       link(x, y);       forests--;       return t;     }     vector<vector<int>> connected_components() {       vector<vector<int>> list(((int)(parent).size()));       for (int i = 0; i < ((int)(parent).size()); i++) {         list[find_set(i)].push_back(i);       }       return list;     }   };   vector<edge> edgeList;   long long a[100005];   int main() {     long long n, m, b, c;     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> a[i];     for (int i = 0; i < m; i++) {       cin >> b >> c;       edgeList.push_back(edge(b - 1, c - 1, min(a[b - 1], a[c - 1])));     }     UnionFind uf(n);     double mstCost = 0;     priority_queue<edge> q;     for (int i = 0; i < edgeList.size(); i++) q.push(edgeList[i]);     while (!q.empty()) {       edge e = q.top();       q.pop();       mstCost += uf.same_set(e.from, e.to) * e.w;     }     cout << fixed << setprecision(6) << 2 * mstCost / (n * (n - 1));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long n, k, x, y, z, A[(1 << 17)], B[(1 << 17)], C[(1 << 17)],       mmp[(1 << 17)], Comb[18][18];   long long O[(1 << 17)], Ans[4][(1 << 17)];   long long powmod(long long x, long long y = 998244353 - 2,                    long long p = 998244353) {     x %= p;     y = (y % (p - 1) + (p - 1)) % (p - 1);     long long ans = 1;     while (y) {       if (y & 1) ans = ans * x % p;       x = x * x % p;       y >>= 1;     }     return ans;   }   signed main() {     scanf( %lld%lld%lld%lld%lld , &n, &k, &x, &y, &z);     for (long long i = 0; i < n; i++) {       scanf( %lld%lld%lld , &A[i], &B[i], &C[i]);       B[i] ^= A[i];       C[i] ^= A[i];     }     for (long long i = 0; i <= k; i++)       for (long long j = 0; j <= i; j++)         Comb[i][j] = !j ? 1 : Comb[i - 1][j - 1] + Comb[i - 1][j];     mmp[0] = 1;     for (long long i = 1; i <= k; i++) {       mmp[i] = 1 - (i % 2);       for (long long j = 0; j < i; j++) mmp[i] -= Comb[i][j] * mmp[j];     }     for (long long b1 = 0; b1 < 2; b1++)       for (long long b2 = 0; b2 < 2; b2++) {         memset(O, 0, sizeof O);         for (long long i = 0; i < n; i++) O[(B[i] * b1) ^ (C[i] * b2)]++;         for (long long i = 1; i < (1 << k); i *= 2)           for (long long j = 0; j < (1 << k); j += i + i)             for (long long k = j; k < j + i; k++)               O[k] = (O[k] + O[k + i]) % (998244353 - 1);         for (long long i = 0; i < (1 << k); i++)           O[i] *= mmp[__builtin_popcount(i)], O[i] %= (998244353 - 1);         for (long long i = 1; i < (1 << k); i *= 2)           for (long long j = 0; j < (1 << k); j += i + i)             for (long long k = j; k < j + i; k++)               O[k + i] = (O[k + i] + O[k]) % (998244353 - 1);         memcpy(Ans[b1 * 2 + b2], O, sizeof O);       }     for (long long i = 0; i < (1 << k); i++) {       long long _00 = Ans[0][i], _01 = Ans[1][i], _10 = Ans[2][i],                 _11 = Ans[3][i];       long long __00 = (_01 + _10 + _11 - _00) / 2;       long long __11 = _11 - __00;       long long __01 = _10 - __00;       long long __10 = _01 - __00;       O[i] = powmod(x - y - z, __11) * powmod(x - y + z, __10) % 998244353 *              powmod(x + y - z, __01) % 998244353 * powmod(x + y + z, __00) %              998244353;     }     long long tot = 0;     for (long long i = 0; i < n; i++) tot ^= A[i];     for (long long i = 1; i < (1 << k); i *= 2)       for (long long j = 0; j < (1 << k); j += i + i)         for (long long k = j; k < j + i; k++) {           long long A = O[k], B = O[k + i];           O[k] = (A + B) % 998244353;           O[k + i] = (A - B) % 998244353;         }     for (long long i = 0; i < (1 << k); i++)       printf( %lld  ,              (O[i ^ tot] * powmod(1 << k) % 998244353 + 998244353) % 998244353);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     int flag = 0;     int count = 0;     if (isupper(s[0])) {       flag = 1;       count = 1;     }     for (int i = 1; i < s.length(); i++) {       if (isupper(s[i])) count++;     }     if (count == s.length()) {       for (int i = 0; i < s.length(); i++) {         s[i] = tolower(s[i]);       }     } else if (count == s.length() - 1 && flag == 0) {       s[0] = toupper(s[0]);       for (int i = 1; i < s.length(); i++) {         s[i] = tolower(s[i]);       }     }     cout << s;   }
#include <bits/stdc++.h>   using namespace std;   int ans[7], flag;   int a[1005], n;   int pos[4][30], pn[4];   struct Pair {     int l, r;   } p[4][300];   int pai[4];   stack<int> s;   bool check() {     for (int i = 1; i <= n; i++) {       if (a[i] != i) return false;     }     return true;   }   void find_pos(int index) {     pn[index] = 0;     pos[index][++pn[index]] = 1;     for (int i = 2; i < n; i++) {       if (!((a[i - 1] == a[i] + 1 && a[i + 1] == a[i] - 1) ||             (a[i - 1] == a[i] - 1 && a[i + 1] == a[i] + 1)))         pos[index][++pn[index]] = i;     }     pos[index][++pn[index]] = n;   }   void to_pair(int index) {     pai[index] = 0;     for (int i = 1; i <= pn[index]; i++) {       for (int j = i; j <= pn[index]; j++) {         p[index][++pai[index]].l = pos[index][i];         p[index][pai[index]].r = pos[index][j];       }     }   }   int main() {     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     find_pos(1);     to_pair(1);     for (int i = 1; i <= pai[1]; i++) {       reverse(a + p[1][i].l, a + p[1][i].r + 1);       find_pos(2);       if (pn[2] > 10) {         reverse(a + p[1][i].l, a + p[1][i].r + 1);         continue;       }       s.push(p[1][i].r);       s.push(p[1][i].l);       to_pair(2);       for (int j = 1; j <= pai[2]; j++) {         reverse(a + p[2][j].l, a + p[2][j].r + 1);         find_pos(3);         if (pn[3] > 6) {           reverse(a + p[2][j].l, a + p[2][j].r + 1);           continue;         }         s.push(p[2][j].r);         s.push(p[2][j].l);         to_pair(3);         for (int k = 1; k <= pai[3]; k++) {           reverse(a + p[3][k].l, a + p[3][k].r + 1);           flag = 0;           if (check()) {             flag = 1;             s.push(p[3][k].r);             s.push(p[3][k].l);             ans[0] = s.size() / 2;             ans[1] = s.top();             s.pop();             ans[2] = s.top();             s.pop();             ans[3] = s.top();             s.pop();             ans[4] = s.top();             s.pop();             ans[5] = s.top();             s.pop();             ans[6] = s.top();             s.pop();             for (int i = 1; i <= 5; i += 2) {               if (ans[i] == ans[i + 1]) {                 ans[0]--;               }             }             cout << ans[0] << endl;             for (int i = 1; i <= 5; i += 2) {               if (ans[i] != ans[i + 1])                 cout << ans[i] <<     << ans[i + 1] << endl;             }           }           if (flag) break;           reverse(a + p[3][k].l, a + p[3][k].r + 1);         }         if (flag) break;         reverse(a + p[2][j].l, a + p[2][j].r + 1);         s.pop();         s.pop();       }       if (flag) break;       reverse(a + p[1][i].l, a + p[1][i].r + 1);       s.pop();       s.pop();     }   }
#include <bits/stdc++.h>   using namespace std;   int n, k, dp[103][10003], C[103][103];   long long m;   int Plus(int x, int y) { return (x += y) >= 1000000007 ? x % 1000000007 : x; }   int mul(long long x, int y) {     return (x *= y) >= 1000000007 ? x % 1000000007 : x;   }   int qpow(int x, long long y) {     int ans = 1;     while (y) {       if (y & 1) ans = mul(ans, x);       x = mul(x, x);       y >>= 1;     }     return ans;   }   int main() {     C[1][0] = C[1][1] = 1;     for (int i = 2; i <= 100; i++) {       C[i][0] = 1;       for (int j = 1; j <= i; j++) {         C[i][j] = Plus(C[i - 1][j], C[i - 1][j - 1]);       }     }     cin >> n >> m >> k;     long long T = (m - 1) / n;     dp[0][0] = 1;     for (int i = 1; i <= n; i++) {       for (int l = 0; l <= min(n, k); l++) {         int syk = qpow(C[n][l], T + (T * n + i <= m));         for (int j = l; j <= k; j++) {           dp[i][j] = Plus(dp[i][j], mul(dp[i - 1][j - l], syk));         }       }     }     cout << dp[n][k] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, x, y, m, nr, nr1, st, dr, i, j, z, p1, p2, aux, a[1004], b[1004],       s[1004], d[1004];   bool ok, c[1004];   int main() {     scanf( %d %d %d , &n, &x, &y);     ok = true;     y = 1;     s[1] = 1;     d[1] = n;     while (ok == true) {       nr1 = 0;       nr = 0;       for (i = 1; i <= y; i++) {         if (s[i] != d[i]) {           for (j = s[i]; j <= ((s[i] + d[i]) / 2); j++) b[++nr1] = j;           for (j = ((s[i] + d[i]) / 2 + 1); j <= d[i]; j++) a[++nr] = j;         }       }       printf( ? %d  , nr1);       for (i = 1; i <= nr1; i++) printf( %d  , b[i]);       printf(  n );       fflush(stdout);       scanf( %d , &z);       if (z != 0 && z != x) break;       for (i = y; i >= 1; i--) {         s[2 * i] = (s[i] + d[i]) / 2 + 1;         d[2 * i] = d[i];         s[2 * i - 1] = s[i];         d[2 * i - 1] = (s[i] + d[i]) / 2;       }       y *= 2;     }     st = 1;     dr = nr1;     while (st <= dr) {       m = (st + dr) / 2;       printf( ? %d  , m);       for (i = 1; i <= m; i++) printf( %d  , b[i]);       printf(  n );       fflush(stdout);       scanf( %d , &z);       if (z != 0 && z != x)         dr = m - 1;       else         st = m + 1;     }     p1 = b[st];     for (i = 1; i <= n; i++) c[i] = false;     for (i = 1; i <= nr1; i++) c[b[i]] = true;     if (y > 1) {       for (i = 1; i <= y; i++) {         if (s[i] <= p1 && p1 <= d[i]) break;       }       nr = 0;       for (j = s[i]; j < p1; j++) {         if (c[j] == false) a[++nr] = j;       }       for (j = (p1 + 1); j <= d[i]; j++) {         if (c[j] == false) a[++nr] = j;       }     }     st = 1;     dr = nr;     if (st < dr) {       while (st <= dr) {         m = (st + dr) / 2;         printf( ? %d  , m);         for (i = 1; i <= m; i++) printf( %d  , a[i]);         printf(  n );         fflush(stdout);         scanf( %d , &z);         if (z != 0 && z != x)           dr = m - 1;         else           st = m + 1;       }     }     p2 = a[st];     if (p1 > p2) {       aux = p1;       p1 = p2;       p2 = aux;     }     printf( ! %d %d n , p1, p2);     fflush(stdout);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline bool chmax(T& a, T b) {     if (a < b) {       a = b;       return 1;     }     return 0;   }   template <class T>   inline bool chmin(T& a, T b) {     if (a > b) {       a = b;       return 1;     }     return 0;   }   template <typename A, size_t N, typename T>   void Fill(A (&array)[N], const T& val) {     fill((T*)array, (T*)(array + N), val);   }   const int inf = INT_MAX / 2;   const long long int INF = LLONG_MAX / 2;   vector<int> g[100010];   int main() {     int n, m;     scanf( %d%d , &n, &m);     vector<pair<long long int, long long int> > check(m);     for (int i = (0); i < (m); i++) {       int x, y;       scanf( %d%d , &x, &y);       x--;       y--;       g[x].push_back(y);       g[y].push_back(x);       check[i] = {x, y};     }     int ans[100010] = {};     int idx = 0;     for (int st = (1); st < (4); st++) {       while (idx < n && ans[idx]) idx++;       if (idx == n) {         printf( -1 n );         return 0;       }       ans[idx] = st;       bool used[100010] = {};       used[idx] = 1;       for (int nxt : g[idx]) {         used[nxt] = 1;       }       for (int i = (0); i < (n); i++)         if (!used[i]) {           if (ans[i] && ans[i] != st) {             printf( -1 n );             return 0;           }           ans[i] = st;         }     }     bool f = 1;     int cnt[4] = {};     for (int i = (0); i < (n); i++) {       if (ans[i] == 0) f = 0;       cnt[ans[i]]++;     }     for (int i = (0); i < (m); i++) {       if (ans[check[i].first] == ans[check[i].second]) f = 0;     }     if (m != cnt[1] * cnt[2] + cnt[2] * cnt[3] + cnt[3] * cnt[1]) f = 0;     if (f)       for (int i = (0); i < (n); i++) printf( %d n , ans[i]);     else       printf( -1 n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline void prin(int n) { printf( %d n , n); }   int main() {     int n;     cin >> n;     long long cur = 3, mi = 7;     for (int i = 1; i < 3 * n; i++) {       cur *= 3;       cur %= (int)1e9 + 7;     }     for (int i = 1; i < n; i++) {       mi *= 7;       mi %= (int)1e9 + 7;     }     cout << (((cur - mi) % ((int)1e9 + 7)) + ((int)1e9 + 7)) % ((int)1e9 + 7);   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, m, i, j, k, c = 0, sm = 0, t = 0, ans = 0;     cin >> n >> m;     int a[n + 2], b[n + 2];     for (i = 0; i < n; i++) cin >> a[i];     for (i = 0; i < n; i++) {       sm += a[i];       if (sm > m) {         sm -= a[t];         ++t;       } else {         ++c;         if (c < ans) ans = c;       }       if (c < 0) c = 0;     }     if (ans < c) ans = c;     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   #pragma GCC optimize( Ofast,no-stack-protector )   #pragma GCC target( sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native )   #pragma GCC optimize( unroll-loops )   template <class T1, class T2, class T3>   inline T3 bigMod(T1 b, T2 p, T3 M) {     if (!p) return 1;     if (p & 1) return b * bigMod(b, p - 1, M) % M;     T3 h = bigMod(b, p >> 1, M);     return h * h % M;   }   template <class T1, class T2>   inline T2 modInverse(T1 a, T2 M) {     return bigMod(a % M, M - 2, M);   }   template <class T>   inline T gcd(T a, T b) {     if (b == 0) return a;     return gcd(b, a % b);   }   template <class T>   inline T lcm(T a, T b) {     return (a / gcd(a, b)) * b;   }   template <class T>   inline string int2String(T a) {     ostringstream str;     str << a;     return str.str();   }   int cal(int pos, vector<int>& v) {     if (pos < 0 || v.empty()) return 0;     vector<int> on, off;     for (const int& x : v) {       if (((bool)(x & (1LL << (pos)))))         on.push_back(x);       else         off.push_back(x);     }     v.clear();     if (on.empty()) return cal(pos - 1, off);     if (off.empty()) return cal(pos - 1, on);     return min(cal(pos - 1, on), cal(pos - 1, off)) + (1 << pos);   }   int main() {     int n;     scanf( %d , &n);     vector<int> v(n);     for (int i = int(0); i < int(n); i++) scanf( %d , &v[i]);     printf( %d n , cal(30, v));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     map<char, int> m;     vector<int> v;     for (int i = 0; i < s.size(); i++) {       m[s[i]]++;     }     map<char, int>::iterator it = m.begin();     while (it != m.end()) {       v.push_back((*it).second);       it++;     }     if (v.size() > 4 || v.size() == 1) {       cout <<  No ;     } else if (v.size() == 4) {       cout <<  Yes ;     } else if (v.size() == 3) {       if (v[0] > 1 || v[1] > 1 || v[2] > 1)         cout <<  Yes ;       else         cout <<  No ;     } else if (v.size() == 2) {       if (v[0] > 1 && v[1] > 1)         cout <<  Yes ;       else         cout <<  No ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   int a[1 << 20];   int main() {     scanf( %d%d , &n, &m);     map<int, int> p;     for (int i = 1; i <= n; i++) {       int fi;       scanf( %d , &fi);       if (p.count(fi)) {         p[fi] = 0;       } else {         p[fi] = i;       }     }     bool im = false, am = false;     for (int i = 1; i <= m; i++) {       int bi;       scanf( %d , &bi);       if (!p.count(bi)) {         im = true;       } else if (p[bi]) {         a[i] = p[bi];       } else {         am = true;       }     }     if (im) {       puts( Impossible );     } else if (am) {       puts( Ambiguity );     } else {       puts( Possible );       for (int i = 1; i <= m; i++) {         printf( %d%c , a[i], i == m ?   n  :    );       }     }   }
#include <bits/stdc++.h>   using namespace std;   long long qpow(int a, int n, int modulus) {     int ret = 1;     while (n) {       if (n & 1) ret = ret * a % modulus;       a = a * a % modulus;       n >>= 1;     }     return ret;   }   int main() {     int n;     scanf( %d , &n);     if (n < 3)       puts( -1 );     else if (n == 3)       puts( 210 );     else {       int m = 210 - qpow(10, n - 1, 210);       putchar( 1 );       if (m >= 0 && m < 10) {         for (int i = 1; i < n - 1; i++) putchar( 0 );         printf( %d n , m);       } else if (m >= 10 && m < 100) {         for (int i = 1; i < n - 2; i++) putchar( 0 );         printf( %d n , m);       } else {         for (int i = 1; i < n - 3; i++) putchar( 0 );         printf( %d n , m);       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, x, y, nr;   int a[110], b[110];   bool used[110];   int main() {     cin >> n;     cin >> x;     for (int i = 1; i <= x; ++i) {       cin >> nr;       used[nr] = true;     }     cin >> y;     for (int i = 1; i <= y; ++i) {       cin >> nr;       used[nr] = true;     }     for (int i = 1; i <= n; ++i) {       if (!used[i]) {         cout <<  Oh, my keyboard! ;         return 0;       }     }     cout <<  I become the guy. ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s[105];   int main() {     int n, k;     cin >> n >> k;     for (int i = 1; i <= n; i++) {       s[i] =  Aa ;       s[i][0] += i / 26;       s[i][1] += i % 26;     }     for (int i = 1; i <= n - k + 1; i++) {       string x;       cin >> x;       if (x ==  NO ) s[i + k - 1] = s[i];     }     for (int i = 1; i <= n; i++) cout << s[i] <<    ;     cout << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mxn = 1e6 + 6;   int n, r, c, t = 1, fr[mxn], nxt[mxn], ans[mxn];   char s[6 * mxn];   inline void dfs(int x) {     if (!x) return;     dfs(x >> 1);     for (int i = 1; i <= n; ++i) {       ans[i] = ans[ans[i]];       if (x & 1) ans[i] = nxt[ans[i]];     }   }   int main() {     scanf( %d%d%d , &n, &r, &c);     for (int i = 1; i <= n; ++i) {       scanf( %s , s + fr[i]);       fr[i + 1] = fr[i] + strlen(s + fr[i]);       s[fr[i + 1]++] =    ;     }     for (int i = n + 1, j = n + 1; i; nxt[ans[i] = i] = j, --i)       for (; fr[j] - fr[i] > c + 1; --j)         ;     dfs(r);     for (int i = 2; i <= n; ++i)       if (ans[i] - i > ans[t] - t) t = i;     for (int i = 1; i <= r; ++i, t = nxt[t], putchar(  n ))       for (int j = fr[t]; j + 1 < fr[nxt[t]]; j++) putchar(s[j]);   }