malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   set<pair<int, int> > *e;   int *parent;   set<int> *v;   int fp(int a) {     if (parent[a] != a) parent[a] = fp(parent[a]);     return parent[a];   }   void dsu(int a, int b) {     a = fp(a);     b = fp(b);     if (a != b) {       if (v[a].size() < v[b].size()) swap(a, b);       for (set<int>::iterator i = v[b].begin(); i != v[b].end(); i++)         v[a].insert(*i);       v[b].clear();       parent[b] = a;     }   }   void add(int a, int b, int c) {     v[fp(a)].insert(b);     v[fp(b)].insert(a);     set<pair<int, int> >::iterator t = e[b].lower_bound(make_pair(c, -1));     if ((t == e[b].end()) || (t->first != c)) {       e[b].insert(make_pair(c, a));     } else {       dsu(a, t->second);     }     t = e[a].lower_bound(make_pair(c, -1));     if ((t == e[a].end()) || (t->first != c)) {       e[a].insert(make_pair(c, b));     } else {       dsu(b, t->second);     }   }   int main() {     int n, m, c, q;     int i;     char ch;     scanf( %d %d %d %d , &n, &m, &c, &q);     parent = new int[100010];     v = new set<int>[100010];     e = new set<pair<int, int> >[100010];     for (i = 0; i < n; i++) {       parent[i] = i;     }     int a, b, cl;     while (m--) {       scanf( %d %d %d , &a, &b, &cl);       add(a, b, cl);     }     while (q--) {       scanf(  %c , &ch);       if (ch ==  ? ) {         scanf( %d %d , &a, &b);         if (fp(a) == fp(b) || (v[fp(a)].find(b) != v[fp(a)].end()))           printf( Yes n );         else           printf( No n );       } else {         scanf( %d %d %d , &a, &b, &cl);         add(a, b, cl);       }     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     map<pair<long long int, long long int>, long long int> m;     long long int ans = 0;     long long int n, count = 0;     cin >> n;     string s;     for (int i = 1; i <= n; i++) {       int l = 0, r = 0;       cin >> s;       for (int j = 0; j < s.length(); j++)         if (s[j] ==  ( )           l++;         else if (s[j] ==  )  && l > 0)           l--;         else           r++;       if (l > 0 && r > 0)         continue;       else if (l == 0 && r == 0) {         ans++;         continue;       } else if (l > 0)         m[make_pair(0, l)]++;       else         m[make_pair(1, r)]++;     }     ans = ans * ans;     count = 0;     for (map<pair<long long int, long long int>, long long int>::iterator it =              m.begin();          it != m.end(); it++)       count = count +               m[it->first] * m[make_pair(!(it->first.first), it->first.second)];     cout << ans + count / 2;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int seq[100];   int ans;   vector<string> in;   void solve(int k, int l) {     if (k <= l) {       vector<int> buf(in.size());       for (int i = 0; i < (int)in.size(); ++i) {         buf[i] = 0;       }       for (int i = 0; i < (int)in.size(); ++i) {         for (int j = 0; j < k; ++j) {           buf[i] += in[i][seq[j]] * pow(10, j);         }       }       sort(buf.begin(), buf.end());       ans = min(ans, *(buf.rbegin()) - *(buf.begin()));       return;     }     for (int i = 0; i < k; ++i) {       if (seq[i] < 0) {         seq[i] = l;         solve(k, l + 1);         seq[i] = -1;       }     }   }   int main(void) {     int n, k;     while (cin >> n >> k) {       ans = (100000000);       for (int i = 0; i < 100; ++i) {         seq[i] = -1;       }       in.clear();       in.resize(n);       for (int i = 0; i < n; ++i) {         cin >> in[i];       }       solve(k, 0);       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int M = 1000000007;   long long n, m;   void solve() {}   void test() {     long long n;     cin >> n;     vector<int> a(n);     int count[101] = {         0,     };     for (long long i = 0; i < n; i++) {       cin >> a[i];       count[a[i]]++;     }     bool flag = 1;     int ans = 0;     for (long long i = 0; i < 101; i++) {       if (count[i] == 0 && flag) {         cout << 2 * i << endl;         return;       }       if (count[i] == 1 && flag) {         ans += i;         flag = 0;       }       if (count[i] == 0 && !flag) {         ans += i;         cout << ans << endl;         return;       }     }   }   int main() {     long long t;     cin >> t;     while (t--) test();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long power(long long a, long long b) {     long long ans = 1;     while (b > 0) {       if (b & 1) {         ans = (ans * a);       }       a = (a * a);       b >>= 1;     }     return ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long a, b, i, l = 0, u;     cin >> a >> b;     if (a > b) {       cout <<  -1 ;       return 0;     }     if (a == 0 && b == 0) {       cout <<  0 ;       return 0;     }     if (a == 0 && b % 2 == 0) {       cout <<  2 n  << b / 2 <<     << b / 2;       return 0;     }     if (a == b) {       cout << 1 <<   n  << a;       return 0;     }     if (a % 2 != 0 && b % 2 != 0) {       long long d = b - a;       if (d == 0) {         cout <<  1 n  << 1;         return 0;       }       if ((a & (d / 2)) == 0) {         cout <<  2               <<   n ;         cout << a + d / 2 <<    ;         cout << d / 2;         return 0;       }       cout <<  3             <<   n ;       cout << a <<    ;       cout << d / 2 <<     << d / 2;       return 0;     }     if (a % 2 == 0 && b % 2 == 0) {       long long d = a;       vector<int> v;       while (d > 0) {         v.push_back(d & 1);         d = d >> 1;       }       while (v.size() <= 60) {         v.push_back(0);       }       for (i = 60; i >= 0; i--) {         if (v[i] == 0) {           u = power(2, i);           if (a + l + 2 * u == b) break;           if (a + l + 2 * u < b) {             l = l + 2 * u;           }         }       }       if (((a + l / 2 + u) ^ (l / 2 + u)) != a) {         long long d = b - a;         cout <<  3               <<   n ;         cout << a <<    ;         cout << d / 2 <<     << d / 2;         return 0;       }       cout <<  2 n ;       cout << a + l / 2 + u <<     << l / 2 + u <<   n ;       return 0;     }     cout <<  -1 ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   int n, k, l[N], r[N], f[2][N], q[N];   int main() {     scanf( %d%d , &n, &k);     for (int i = 1; i <= k; ++i) scanf( %d%d , &l[i], &r[i]);     f[0][0] = 0;     for (int i = 1; i <= (n << 1); ++i) f[0][i] = 0x3f3f3f3f;     for (int i = 1; i <= k; ++i) {       int cur = i & 1, last = !cur;       memset(f[cur], 0x3f, sizeof(int) * (n + 1));       int L = 1, R = 0, now = 0;       for (int j = min(n, r[i]); j >= 0; --j) {         f[cur][j] = f[last][j];         int ql = l[i] - j, qr = min(r[i] - j, n);         while (now <= qr) {           while (L <= R && f[last][q[R]] > f[last][now]) --R;           q[++R] = now;           ++now;         }         while (L <= R && q[L] < ql) ++L;         f[cur][j] = min(f[cur][j], f[last][q[L]] + 1);       }       L = 1, R = 0;       now = 0;       for (int j = 0; j <= n && j <= r[i]; ++j) {         int ql = j + l[i] - r[i], qr = j;         while (now <= qr) {           while (L <= R && f[last][q[R]] > f[last][now]) --R;           q[++R] = now;           ++now;         }         while (L <= R && q[L] < ql) ++L;         f[cur][j] = min(f[cur][j], f[last][q[L]] + 2);       }     }     if (f[k & 1][n] == 0x3f3f3f3f) {       puts( Hungry );       return 0;     }     puts( Full );     printf( %d n , f[k & 1][n]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     int n, x[100005];     cin >> n;     for (int i = 1; i <= n; i++) cin >> x[i];     sort(x + 1, x + 1 + n);     for (int i = 2; i <= n; i++)       if (x[i - 1] * 2 > x[i] && x[i - 1] != x[i]) return cout <<  YES , 0;     cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline bool ylmin(T &a, T b) {     return a < b ? 0 : (a = b, 1);   }   template <class T>   inline bool ylmax(T &a, T b) {     return a > b ? 0 : (a = b, 1);   }   template <class T>   inline T abs(T x) {     return x < 0 ? -x : x;   }   inline char read() {     static const int IO_LEN = 1024 * 1024;     static char buf[IO_LEN], *ioh, *iot;     if (ioh == iot) {       iot = (ioh = buf) + fread(buf, 1, IO_LEN, stdin);       if (ioh == iot) return -1;     }     return *ioh++;   }   template <class T>   inline void read(T &x) {     static int iosig;     static char ioc;     for (iosig = 0, ioc = read(); !isdigit(ioc); ioc = read())       if (ioc ==  - ) iosig = 1;     for (x = 0; isdigit(ioc); ioc = read()) x = (x << 1) + (x << 3) + (ioc ^  0 );     if (iosig) x = -x;   }   const int MAXN = 2e5 + 10;   long long T, n, a[MAXN], b[MAXN], id[MAXN];   inline bool cmp(int x, int y) { return a[x] < a[y]; }   int main() {     for (read(T); T; T--) {       read(n);       for (int i = (1); i <= (n); i++) read(a[i]), id[i] = i;       for (int i = (1); i <= (n); i++) read(b[i]);       sort(id + 1, id + n + 1, cmp);       long long sum = 0, ans = 1e9;       for (int i = (1); i <= (n); i++) sum += b[i];       for (int i = (0); i <= (n); i++) {         sum -= b[id[i]];         ylmin(ans, max(a[id[i]], sum));       }       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int temp, i, j, k, T;   long long pow_r(long long d, long long n) {     long long x = 1ll;     while (n > 0) {       if (n & 1) x = (x * d);       d = (d * d);       n >>= 1;     }     return x;   }   int n, da[6], db[6];   pair<int, pair<int, int> > a[8];   int dist(int p, int q) {     return (a[p].second.first - a[q].second.first) *                (a[p].second.first - a[q].second.first) +            (a[p].second.second - a[q].second.second) *                (a[p].second.second - a[q].second.second);   }   void check() {     da[0] = dist(0, 1);     da[1] = dist(1, 2);     da[2] = dist(2, 3);     da[3] = dist(3, 0);     da[4] = dist(0, 2);     da[5] = dist(1, 3);     db[0] = dist(4, 5);     db[1] = dist(5, 6);     db[2] = dist(6, 7);     db[3] = dist(7, 4);     db[4] = dist(4, 6);     db[5] = dist(5, 7);     if (da[0] == da[1] && da[1] == da[2] && da[2] == da[3] && da[4] == da[5] &&         db[0] == db[2] && db[1] == db[3] && db[4] == db[5]) {       puts( YES );       cout << a[0].first <<     << a[1].first <<     << a[2].first <<                << a[3].first << endl;       cout << a[4].first <<     << a[5].first <<     << a[6].first <<                << a[7].first << endl;       exit(0);     }   }   int main() {     n = 8;     i = 0;     while (n--) {       scanf( %d , &a[i].second.first);       scanf( %d , &a[i].second.second);       a[i].first = i + 1;       ++i;     }     n = 8;     sort(a, a + 8);     do {       check();     } while (next_permutation(a, a + 8));     puts( NO );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int p = 1e9 + 7;   inline int read() {     int neg = 1, num = 0;     char c = getchar();     for (; !isdigit(c); c = getchar())       if (c ==  - ) neg = -1;     for (; isdigit(c); c = getchar()) num = (num << 1) + (num << 3) + c -  0 ;     return neg * num;   }   int n, cnt[200010];   inline int Pow(int x, int y) {     int res = 1;     for (; y; y >>= 1, x = 1ll * x * x % p)       if (y & 1) res = 1ll * res * x % p;     return res;   }   int main() {     n = read();     for (int i = 1; i <= n; i++) {       int a = read();       if (a != -1) cnt[a]++;     }     int sum = 0;     for (int i = 1; i <= n; i++) sum = (sum + Pow(2, cnt[i]) - 1) % p;     sum = Pow(2, n - 1) - 1 - sum;     sum = (sum % p + p) % p;     cout << sum;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   bool prime(int x) {     int cnt = 0;     for (int i = 1; i <= x; i++)       if (x % i == 0) cnt++;     return (cnt <= 2);   }   void fl() { fflush(stdout); }   int kul[] = {4, 9, 25, 49};   char odg[5];   int main() {     int prosti = 1;     for (int i = 0; i < 4; i++) {       printf( %d n , kul[i]);       fl();       scanf( %s , odg);       if (odg[0] ==  y ) prosti = 0;     }     if (prosti) {       int cnt = 0;       for (int i = 2; i <= 50; i++) {         if (prime(i)) {           printf( %d n , i);           fl();           scanf( %s , odg);           if (odg[0] ==  y ) cnt++;         }       }       if (cnt >= 2) prosti = 0;     }     if (prosti == 1) {       printf( prime n );       fl();     } else {       printf( composite n );       fl();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const double PI = 3.1415926535;   double squared(double n) { return n * n; }   typedef struct {     int cx;     int cy;     int r;     int R;   } circle_t;   bool isBlack(double x, double y, circle_t c) {     double val = squared(x - (double)c.cx) + squared(y - (double)c.cy);     if (val > squared(c.R)) {       return false;     } else if (val >= squared(c.r)) {       return true;     } else {       return false;     }   }   int returnOkNum(circle_t c, circle_t c2) {     int blackOutNum = 0;     int blackInNum = 0;     int ret = 0;     const int DIVIDE = 100000;     for (int i = 0; i < DIVIDE; ++i) {       double xOut = (double)c.R * cos(2.0 * PI * i / DIVIDE) + c.cx;       double yOut = (double)c.R * sin(2.0 * PI * i / DIVIDE) + c.cy;       double xIn = (double)c.r * cos(2.0 * PI * i / DIVIDE) + c.cx;       double yIn = (double)c.r * sin(2.0 * PI * i / DIVIDE) + c.cy;       if (isBlack(xOut, yOut, c2)) {         ++blackOutNum;       }       if (isBlack(xIn, yIn, c2)) {         ++blackInNum;       }     }     if (blackOutNum <= 3) {       ++ret;     }     if (blackInNum <= 3) {       ++ret;     }     return ret;   }   int main(void) {     vector<circle_t> cs(2);     for (int i = 0; i < 2; ++i) {       cin >> cs[i].cx >> cs[i].cy >> cs[i].r >> cs[i].R;     }     int ret = returnOkNum(cs[0], cs[1]);     ret += returnOkNum(cs[1], cs[0]);     cout << ret << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, x;     scanf( %d%d , &n, &x);     int i, j, ans = 0;     int a1[100002], a2[100002];     for (i = 1; i <= n; i++) {       scanf( %d%d , &a1[i], &a2[i]);       ans = ans + (a2[i] - a1[i] + 1) + (a1[i] - a2[i - 1] - 1) % x;     }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   int i, j, k, n, m, a[128][128], z, x, y, t, s, l, b, A, v[128][128],       f[256][128], g[256][128], X[] = {0, 1, 0, -1}, Y[] = {1, 0, -1, 0};   char u[128][128];   char p[] =  0123456789abcdefghijklmnopqrstuvwxyz ;   void dfs(int x, int y, int d) {     for (int i = 0; i < 4; ++i) {       t = x + X[i];       s = y + Y[i];       if (t >= 0 && s >= 0 && t < n && s < m)         if (d + a[t][s] < f[t * m + s][z]) {           f[t * m + s][z] = d + a[t][s];           g[t * m + s][z] = 0;           dfs(t, s, d + a[t][s]);         }     }   }   void ff(int x, int y, int z) {     u[x][y] =  X ;     if (g[x * m + y][z] == 0) {       int r = f[x * m + y][z] - a[x][y];       if (r) {         for (int i = 0; i < 4; ++i) {           t = x + X[i];           s = y + Y[i];           if (t >= 0 && s >= 0 && t < n && s < m)             if (f[t * m + s][z] == r) {               ff(t, s, z);               break;             }         }       }     } else {       int w = g[x * m + y][z];       for (int i = 0; i < 4; ++i) {         t = x + X[i];         s = y + Y[i];         if (t >= 0 && s >= 0 && t < n && s < m)           if (f[t * m + s][w] + f[x * m + y][z ^ w] == f[x * m + y][z]) {             ff(t, s, w);             ff(x, y, z ^ w);             break;           }       }     }   }   int main() {     scanf( %d%d%d , &n, &m, &k);     for (; i < n; ++i) {       memset(u[i],  . , m);       for (j = 0; j < m; ++j) scanf( %d , a[i] + j);     }     memset(f, 32, sizeof(f));     memset(v, 255, sizeof(v));     for (i = 0; i < k; ++i) {       scanf( %d%d , &x, &y);       --x;       --y;       z = 1 << i;       v[x][y] = i;       dfs(x, y, f[x * m + y][z] = a[x][y]);     }     for (z = 3; z < (1 << k); ++z)       if (__builtin_popcount(z) > 1)         for (x = z - 1; x; x = (x - 1) & z) {           y = x ^ z;           for (i = A = 0; i < n; ++i)             for (j = 0; j < m; ++A, ++j)               for (l = 0; l < 4; ++l) {                 t = i + X[l];                 s = j + Y[l];                 if (t >= 0 && s >= 0 && t < n && s < m) {                   b = t * m + s;                   if (f[A][x] + f[b][y] < f[A][z]) {                     f[A][z] = f[A][x] + f[b][y];                     g[A][z] = y;                   }                 }               }           for (y = 16; y--;)             for (i = A = 0; i < n; ++i)               for (j = 0; j < m; ++A, ++j)                 for (l = 0; l < 4; ++l) {                   t = i + X[l];                   s = j + Y[l];                   if (t >= 0 && s >= 0 && t < n && s < m)                     if (!~v[t][s]) {                       b = t * m + s;                       if (f[A][z] + a[t][s] < f[b][z]) {                         f[b][z] = f[A][z] + a[t][s];                         g[b][z] = 0;                       }                     }                 }         }     for (z = (1 << k) - 1, i = n * m, j = 0; --i;)       if (f[i][z] < f[j][z]) j = i;     printf( %d n , f[j][z]);     ff(j / m, j % m, z);     for (i = 0; i < n; ++i) puts(u[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 10;   const int M = 1e3 + 10;   const long long mod = 1e9 + 7;   const long long inf = 1e18 + 10;   int a[N], st[N], ft[N], ind[N], lzy[4 * N], t, n, m;   vector<int> adj[N];   bitset<M> seg[4 * N], P, res, one;   void dfs(int v, int p) {     st[v] = t;     ind[t++] = v - 1;     for (int u : adj[v])       if (u != p) dfs(u, v);     ft[v] = t;   }   void build(int l = 0, int r = n, int id = 1) {     if (r - l == 1) {       seg[id][a[ind[l]]] = 1;       return;     }     int mid = (l + r) / 2;     build(l, mid, 2 * id);     build(mid, r, 2 * id + 1);     seg[id] = seg[2 * id] | seg[2 * id + 1];   }   void shift(int id) {     int x = lzy[id];     seg[2 * id] = (seg[2 * id] << x) & one | (seg[2 * id] >> (m - x));     seg[2 * id + 1] = (seg[2 * id + 1] << x) & one | (seg[2 * id + 1] >> (m - x));     lzy[2 * id] = (lzy[2 * id] + x) % m;     lzy[2 * id + 1] = (lzy[2 * id + 1] + x) % m;     lzy[id] = 0;   }   void upd(int l, int r, int x, int s = 0, int e = n, int id = 1) {     if (e <= l || r <= s) return;     if (l <= s && e <= r) {       seg[id] = (seg[id] << x) & one | (seg[id] >> (m - x));       lzy[id] = (lzy[id] + x) % m;       return;     }     shift(id);     int mid = (s + e) / 2;     upd(l, r, x, s, mid, 2 * id);     upd(l, r, x, mid, e, 2 * id + 1);     seg[id] = seg[2 * id] | seg[2 * id + 1];   }   void get(int l, int r, int s = 0, int e = n, int id = 1) {     if (e <= l || r <= s) return;     if (l <= s && e <= r) {       res |= seg[id];       return;     }     shift(id);     int mid = (s + e) / 2;     get(l, r, s, mid, 2 * id);     get(l, r, mid, e, 2 * id + 1);   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> a[i], a[i] %= m;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dfs(1, 0);     build();     for (int i = 2; i < m; i++) P[i] = 1;     for (int i = 2; i < m; i++)       if (P[i])         for (int j = i * i; j < m; j += i) P[j] = 0;     for (int i = 0; i < m; i++) one[i] = 1;     int q;     cin >> q;     while (q--) {       int typ;       cin >> typ;       if (typ == 1) {         int v, x;         cin >> v >> x;         x %= m;         upd(st[v], ft[v], x);       } else {         int v;         cin >> v;         res &= 0;         get(st[v], ft[v]);         cout << (res & P).count() <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using lint = long long int;   using P = pair<int, int>;   using PL = pair<lint, lint>;   constexpr int MOD = 1000000007;   constexpr lint B1 = 1532834020;   constexpr lint M1 = 2147482409;   constexpr lint B2 = 1388622299;   constexpr lint M2 = 2147478017;   constexpr int INF = 2147483647;   void yes(bool expr) { cout << (expr ?  Yes  :  No ) <<   n ; }   template <class T>   void chmax(T &a, const T &b) {     if (a < b) a = b;   }   template <class T>   void chmin(T &a, const T &b) {     if (b < a) a = b;   }   vector<int> csort(vector<int> &c, vector<int> &tmp) {     vector<int> ret;     int ptr = c.size();     for (int i = (tmp.size()) - 1, i_begin_ = (0); i >= i_begin_; i--) {       ptr -= tmp[i];       for (int j = (0), j_end_ = (tmp[i]); j < j_end_; j++)         ret.push_back(c[ptr + j]);     }     return ret;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n;     cin >> n;     vector<int> c(n);     for (int i = (0), i_end_ = (n); i < i_end_; i++) cin >> c[i];     for (int i = (0), i_end_ = (n); i < i_end_; i++) c[i]--;     int opes = 0;     vector<vector<int>> ans;     while (true) {       bool comp = true;       for (int i = (0), i_end_ = (n); i < i_end_; i++)         if (c[i] != i) {           comp = false;           break;         }       if (comp) break;       vector<int> tmp;       for (int i = (0), i_end_ = (opes); i < i_end_; i++) tmp.push_back(1);       if ((n - opes) % 2 == 0) {         for (int i = (0), i_end_ = (n); i < i_end_; i++)           if (c[i] == opes) {             tmp.push_back(i + 1 - opes);             if (n - 1 - i > 0) tmp.push_back(n - 1 - i);             break;           }       } else {         for (int i = (0), i_end_ = (n); i < i_end_; i++)           if (c[i] == opes) {             tmp.push_back(n - opes - i);             if (i > 0) tmp.push_back(i);             break;           }         reverse((tmp).begin(), (tmp).end());       }       if (tmp.size() > 1) {         ans.push_back(tmp);         c = csort(c, tmp);       }       opes++;     }     cout << ans.size() << endl;     for (int i = (0), i_end_ = (ans.size()); i < i_end_; i++) {       cout << ans[i].size() <<    ;       for (int j = (0), j_end_ = (ans[i].size()); j < j_end_; j++)         cout << ans[i][j] << (j != ans[i].size() - 1 ?     :   );       cout <<   n ;     }   }