malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1000010;   struct Trie {     int next[maxn][26], fail[maxn];     int depth[maxn];     vector<int> sons[maxn];     int _dp[maxn][2];     int root, L;     int newnode() {       for (int i = 0; i < 26; i++) next[L][i] = -1;       return L++;     }     void init() {       L = 0;       root = newnode();       depth[root] = 0;     }     void insert(char buf[]) {       int len = strlen(buf);       int now = root;       for (int i = 0; i < len; i++) {         if (next[now][buf[i] -  a ] == -1) next[now][buf[i] -  a ] = newnode();         now = next[now][buf[i] -  a ];         depth[now] = i + 1;       }     }     void build() {       queue<int> Q;       fail[root] = root;       for (int i = 0; i < 26; i++)         if (next[root][i] == -1)           next[root][i] = root;         else {           fail[next[root][i]] = root;           Q.push(next[root][i]);         }       while (!Q.empty()) {         int now = Q.front();         Q.pop();         for (int i = 0; i < 26; i++)           if (next[now][i] == -1)             next[now][i] = next[fail[now]][i];           else {             fail[next[now][i]] = next[fail[now]][i];             Q.push(next[now][i]);           }       }     }     void build_edge() {       for (int i = 0; i < L; i++) sons[i].clear();       for (int i = 1; i < L; i++) {         int j = fail[i];         sons[j].push_back(i);       }     }     int dp(int u) {       _dp[u][0] = 0, _dp[u][1] = 1;       for (int i = 0; i < sons[u].size(); i++) {         int v = sons[u][i];         dp(v);         _dp[u][0] += max(_dp[v][0], _dp[v][1]);         _dp[u][1] +=             (depth[v] - depth[u] == 1) ? _dp[v][0] : max(_dp[v][0], _dp[v][1]);       }       return _dp[u][0];     }   };   char buf[maxn];   Trie ac;   int main() {     int T;     int n;     scanf( %d , &T);     while (T--) {       scanf( %d , &n);       ac.init();       for (int i = 0; i < n; i++) {         scanf( %s , buf);         ac.insert(buf);       }       ac.build();       ac.build_edge();       printf( %d n , ac.dp(0));     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 20;   const int MOD = (int)1e9 + 7;   const int dx[] = {0, -1, 0, 1, 0};   const int dy[] = {0, 0, 1, 0, -1};   struct Matrix {     long long mat[N][N];   };   bool blocked[N][N];   int m, n, q;   int size;   Matrix operator*(const Matrix a, const Matrix b) {     Matrix c;     for (int i = 0; i < size; ++i)       for (int j = 0; j < size; ++j) {         c.mat[i][j] = 0;         for (int k = 0; k < size; ++k)           c.mat[i][j] = (c.mat[i][j] + a.mat[i][k] * b.mat[k][j]) % MOD;       }     return c;   }   Matrix power(Matrix a, int p) {     Matrix ans;     memset(ans.mat, 0, sizeof(ans.mat));     for (int i = 0; i < size; ++i) ans.mat[i][i] = 1;     for (; p; p >>= 1) {       if (p & 1) ans = ans * a;       a = a * a;     }     return ans;   }   int getIndex(int x, int y) { return x * n + y; }   void update(Matrix &a) {     for (int i = 0; i < m; ++i)       for (int j = 0; j < n; ++j) {         int cur = getIndex(i, j);         for (int k = 0; k < size; ++k) a.mat[cur][k] = 0;         if (blocked[i][j]) continue;         for (int d = 0; d < 5; ++d) {           int x = i + dx[d], y = j + dy[d];           if (x < 0 || y < 0 || x >= m || y >= n || blocked[x][y]) continue;           a.mat[cur][getIndex(x, y)] = 1;         }       }   }   void multiply(Matrix gap, long long ans[]) {     int newAns[N];     for (int i = 0; i < size; ++i) {       newAns[i] = 0;       for (int j = 0; j < size; ++j)         newAns[i] = (newAns[i] + ans[j] * gap.mat[i][j]) % MOD;     }     for (int i = 0; i < size; ++i) ans[i] = newAns[i];   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(nullptr);     cin >> m >> n >> q;     size = m * n;     Matrix a;     update(a);     long long ans[N];     memset(ans, 0, sizeof(ans));     ans[0] = 1;     int lastT = 1;     while (q--) {       int type, x, y, t;       cin >> type >> x >> y >> t;       --x;       --y;       Matrix gap = power(a, t - lastT - 1);       multiply(gap, ans);       multiply(a, ans);       if (type != 1) {         blocked[x][y] ^= 1;         update(a);       }       if (type == 1) cout << ans[getIndex(x, y)] <<   n ;       lastT = t;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 110;   int a[MAXN];   int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }   int main() {     int n, i;     while (scanf( %d , &n) == 1) {       scanf( %d , &a[0]);       int temp = a[0];       int mmax = a[0];       for (i = 1; i < n; i++) {         scanf( %d , &a[i]);         temp = gcd(temp, a[i]);         mmax = max(a[i], mmax);       }       int ans = mmax / temp - n;       if (ans & 1)         printf( Alice n );       else         printf( Bob n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   vector<int> u[100005];   int d[100005];   int a[100005], b[100005], x[100005];   int p[18][100005];   int up[100005], down[100005];   void go(int i, int pr) {     p[0][i] = pr;     d[i] = d[pr] + 1;     for (int j : u[i])       if (j != pr) {         go(j, i);       }   }   void go2(int i, int pr) {     for (int j : u[i])       if (j != pr) {         go2(j, i);         up[i] += up[j];         down[i] += down[j];       }   }   int lca(int a, int b) {     if (d[a] < d[b]) swap(a, b);     for (int i = 17; i >= 0; i--)       if (d[p[i][a]] >= d[b]) a = p[i][a];     if (a == b) return a;     for (int i = 17; i >= 0; i--)       if (p[i][a] != p[i][b]) {         a = p[i][a];         b = p[i][b];       }     return p[0][a];   }   long long cof[1000005];   long long pw[1000005];   int main() {     scanf( %d , &n);     pw[0] = 1;     for (int i = (1); i < (1000005); i++) {       pw[i] = (pw[i - 1] * 2) % 1000000007ll;       cof[i] = cof[i - 1] + pw[i - 1];       if (cof[i] >= 1000000007ll) cof[i] -= 1000000007ll;     }     for (int i = (0); i < (n - 1); i++) {       int l, m, y;       scanf( %d%d%d , &l, &m, &y);       u[l].push_back(m);       u[m].push_back(l);       a[i] = l;       b[i] = m;       x[i] = y;     }     go(1, 0);     for (int i = (1); i < (18); i++)       for (int j = (1); j < (n + 1); j++) p[i][j] = p[i - 1][p[i - 1][j]];     int pos = 1;     int k;     scanf( %d , &k);     for (int z = (0); z < (k); z++) {       int nxt;       scanf( %d , &nxt);       int l = lca(pos, nxt);       up[pos]++;       up[l]--;       down[nxt]++;       down[l]--;       pos = nxt;     }     go2(1, 0);     long long res = 0;     for (int i = (0); i < (n - 1); i++)       if (x[i]) {         if (d[a[i]] < d[b[i]]) {           int r = up[b[i]];           res += cof[r];         } else {           int r = down[a[i]];           res += cof[r];         }       }     res %= 1000000007ll;     printf( %lld n , res % 1000000007ll);   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const int MAXX = 2e6 + 10;   long long f(long long n) {     long long ret = n;     for (long long i = 2; i * i <= n; i++) {       if (n % i == 0) {         while (n % i == 0) n /= i;         ret -= ret / i;       }     }     if (n > 1) ret -= ret / n;     return ret;   }   long long g(long long n) { return n; }   long long F(long long n, long long k) {     if (k == 1) return f(g(n));     if (n == 1) return 1ll;     if (k & 1)       return F(f(n), k - 1);     else       return F(g(n), k - 1);   }   int main() {     long long n, k;     scanf( %lld %lld , &n, &k);     long long ans = F(n, k);     printf( %lld , ans % mod);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     pair<int, int> a[105];     for (int i = 0; i < n; i++) {       cin >> a[i].first;       a[i].second = i + 1;     }     sort(a, a + n);     for (int i = 0; i < n / 2; i++)       cout << a[i].second <<     << a[n - i - 1].second << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   vector<string> checkWorks(vector<vector<bool>> arr) {     vector<int> row = vector<int>(n, 2);     vector<int> col = vector<int>(m, 2);     row[0] = 0;     for (int j = 0; j < m; j++) {       col[j] = arr[0][j];     }     bool works = true;     for (int i = 1; i < n; i++) {       for (int j = 0; j < m; j++) {         bool shouldBe = arr[i][j] ^ col[j];         if (row[i] == 2) {           row[i] = shouldBe;         } else {           if (row[i] != shouldBe) {             works = false;             break;           }         }       }       if (!works) break;     }     if (works) {       string a;       for (int i = 0; i < n; i++) {         if (row[i])           a.push_back( 1 );         else           a.push_back( 0 );       }       string b;       for (int j = 0; j < m; j++) {         if (col[j])           b.push_back( 1 );         else           b.push_back( 0 );       }       vector<string> ans;       ans.push_back(a);       ans.push_back(b);       return ans;     }     row[0] = 1;     for (int j = 0; j < m; j++) {       col[j] = !arr[0][j];     }     works = true;     for (int i = 1; i < n; i++) {       for (int j = 0; j < m; j++) {         bool shouldBe = arr[i][j] ^ col[j];         if (row[i] == 2) {           row[i] = shouldBe;         } else {           if (row[i] != shouldBe) {             works = false;             break;           }         }       }       if (!works) break;     }     if (works) {       string a;       for (int i = 0; i < n; i++) {         if (row[i])           a.push_back( 1 );         else           a.push_back( 0 );       }       string b;       for (int j = 0; j < m; j++) {         if (col[j])           b.push_back( 1 );         else           b.push_back( 0 );       }       vector<string> ans;       ans.push_back(a);       ans.push_back(b);       return ans;     }     return vector<string>();   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n >> m;     vector<vector<bool>> arr = vector<vector<bool>>(n, vector<bool>(m));     vector<vector<bool>> arrCopy = vector<vector<bool>>(n, vector<bool>(m));     int x;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         cin >> x;         if (x) {           arr[i][j] = false;         } else {           arr[i][j] = true;         }         arrCopy[i][j] = arr[i][j];       }     }     vector<string> maybe = checkWorks(arr);     if (maybe.size() > 0) {       cout <<  YES  << endl;       cout << maybe[0] << endl;       cout << maybe[1] << endl;       return 0;     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         arrCopy[i][j] = !arr[i][j];         maybe = checkWorks(arrCopy);         if (maybe.size() > 0) {           cout <<  YES  << endl;           cout << maybe[0] << endl;           cout << maybe[1] << endl;           return 0;         }       }     }     cout <<  NO  << endl;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int a[100001];   int pmid;   int pfromside;   char sideequal[50001];   int leftplenty, rightplenty;   int ln[100001] = {0}, rn[100001] = {0};   int wn1[100001] = {0}, wn2[100001] = {0};   int possible(int l, int r) {     int includemid;     int left = l - 1;     int right = n - r;     int width = r - l + 1;     if (n & 1)       includemid = (l <= (n / 2 + 1) && r >= (n / 2 + 1));     else       includemid = (l <= (n / 2) && r > (n / 2));     if (includemid) {       if (left < right)         return (left <= pfromside) && (right <= rightplenty);       else         return (right <= pfromside) && (left <= leftplenty);     } else {       int side;       if (left < right)         side = left;       else         side = right;       return (side <= pfromside) && ((n - side - side - width - width) <= pmid) &&              (sideequal[side + width]);     }   }   int findminr(int l) {     int no, yes;     if (!possible(l, n)) return 0;     yes = n;     if (possible(l, l)) return l;     no = l;     while (no != yes - 1) {       int newmid = (yes + no) / 2;       if (possible(l, newmid))         yes = newmid;       else         no = newmid;     }     return yes;   }   int main() {     int i;     int minr;     long long total = 0;     int lj, rj;     cin >> n;     for (i = 1; i <= n; i++) cin >> a[i];     for (i = 1; i <= n / 2; i++) {       if (a[i] != a[n - i + 1]) break;     }     pfromside = i - 1;     pmid = n & 1;     lj = n / 2;     rj = n / 2 + 1 + (n & 1);     for (i = 0; i < n / 2; i++) {       if (a[lj] != a[rj]) break;       lj--;       rj++;     }     pmid += i * 2;     int wasequal, diffn = 0;     lj = 1;     rj = n;     sideequal[0] = 1;     for (i = 1; i <= n / 2; i++) {       wasequal = (ln[a[lj]] == rn[a[lj]]);       ln[a[lj]]++;       if (ln[a[lj]] == rn[a[lj]])         diffn--;       else if (wasequal)         diffn++;       wasequal = (ln[a[rj]] == rn[a[rj]]);       rn[a[rj]]++;       if (ln[a[rj]] == rn[a[rj]])         diffn--;       else if (wasequal)         diffn++;       if (diffn == 0)         sideequal[i] = 1;       else         sideequal[i] = 0;       lj++;       rj--;     }     int odds = 0;     for (i = 1; i <= n; i++) {       wn1[a[i]]++;       wn2[a[i]]++;       if (wn1[a[i]] & 1)         odds++;       else         odds--;     }     if (odds > 1) {       cout << 0;       return 0;     }     lj = 1;     for (i = 0; i < n / 2; i++) {       wn1[a[lj]] -= 2;       if (wn1[a[lj]] < 0) break;       lj++;     }     leftplenty = i;     rj = n;     for (i = 0; i < n / 2; i++) {       wn2[a[rj]] -= 2;       if (wn2[a[rj]] < 0) break;       rj--;     }     rightplenty = i;     for (i = 1; i <= n; i++) {       minr = findminr(i);       if (minr) total = total + (long long)(n - minr + 1);     }     cout << total;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long a[1003];   int main() {     long long n, s;     cin >> n >> s;     long long miner = 0x3f3f3f3f3f3f3f3f;     long long sumer = 0;     for (long long i = 0; i < n; i++) {       cin >> a[i];       sumer += a[i];       miner = min(miner, a[i]);     }     if (sumer < s) {       cout <<  -1  << endl;       return 0;     }     sumer = 0;     for (long long i = 0; i < n; i++) {       sumer += a[i] - miner;       a[i] = miner;     }     if (sumer >= s) {       cout << miner << endl;     } else {       long long need = s - sumer;       miner -= need / n;       if (need % n != 0) {         miner--;       }       cout << miner << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T BMOD(T p, T e, T m) {     T ret = 1;     while (e) {       if (e & 1) ret = (ret * p) % m;       p = (p * p) % m;       e >>= 1;     }     return (T)ret;   }   template <typename T>   inline T POW(T B, T P) {     if (P == 0) return 1;     if (P & 1)       return B * POW(B, P - 1);     else       return SQR(POW(B, P / 2));   }   template <typename T>   inline T ModInv(T b, T m) {     return BMOD(b, m - 2, m);   }   template <typename T>   inline T ABS(T a) {     if (a < 0)       return -a;     else       return a;   }   template <typename T>   inline T gcd(T a, T b) {     if (a < 0) return gcd(-a, b);     if (b < 0) return gcd(a, -b);     return (b == 0) ? a : gcd(b, a % b);   }   template <typename T>   inline T lcm(T a, T b) {     if (a < 0) return lcm(-a, b);     if (b < 0) return lcm(a, -b);     return a * (b / gcd(a, b));   }   int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};   int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};   int n, x, trck[200005], arr[100005];   int main() {     scanf( %d%d , &n, &x);     for (int i = 1; i <= n; i++) {       scanf( %d , &arr[i]);       trck[arr[i]]++;     }     long long int res = 0;     for (int i = 1; i <= 100000; i++) {       int nm = i ^ x;       if (trck[nm] && trck[i]) {         long long int cnt = (long long int)trck[nm] * trck[i];         if (x == 0) cnt = (long long int)trck[nm] * (trck[i] - 1);         res += cnt;       }     }     res /= 2;     printf( %lld , res), puts(  );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <typename T>   inline T sqr(const T& a) {     return a * a;   }   template <typename T>   inline int sign(const T& a) {     return a < 0 ? -1 : a > 0;   }   void task();   int main() {     task();     return 0;   }   char dp[21][1 << 5][161050 + 10];   char par[21][1 << 5][161050 + 10];   int n, m;   int an[6], am[21];   vector<int> mask_by_cnt[6];   vector<int> to_11[161050 + 10];   int pw[11];   inline int to_number(vector<int>& v) {     return v[0] + v[1] * 11 + v[2] * 11 * 11 + v[3] * 11 * 11 * 11 +            v[4] * 11 * 11 * 11 * 11;   }   void task() {     ios_base::sync_with_stdio(0);     cin >> n >> m;     for (int i = 0; i < n; ++i) cin >> an[i];     for (int i = 0; i < m; ++i) cin >> am[i];     pw[0] = 1;     for (int i = 1; i < 11; ++i) pw[i] = pw[i - 1] * 11;     for (int mask = 0; mask < (1 << n); ++mask) {       vector<int> v;       for (int j = 0; j < n; ++j) v.push_back((mask & (1 << j)) > 0);       v.push_back(17);       int cnt = 0;       for (int i = v.size() - 2; i >= 0; --i)         cnt += v[i] == 1 && v[i] != v[i + 1];       mask_by_cnt[cnt].push_back(mask);     }     for (int a = 0; a <= 10; ++a)       for (int b = 0; b <= 10; ++b)         for (int c = 0; c <= 10; ++c)           for (int d = 0; d <= 10; ++d)             for (int e = 0; e <= 10; ++e) {               int number = e + d * 11 + c * 11 * 11 + b * 11 * 11 * 11 +                            a * 11 * 11 * 11 * 11;               to_11[number] = {e, d, c, b, a};             }     int limit_number = 1;     for (int i = 0; i < n; ++i) limit_number *= 11;     dp[0][0][0] = 1;     par[0][0][0] = -1;     for (int i = 0; i < m; ++i)       for (int prev_mask : mask_by_cnt[i - 1 >= 0 ? am[i - 1] : 0])         for (int number = 0; number < limit_number; ++number)           if (dp[i][prev_mask][number])             for (int cur_mask : mask_by_cnt[am[i]]) {               int nb = number;               int ok = 1;               for (int j = 0; j < n; ++j)                 if ((prev_mask & (1 << j)) == 0 && (cur_mask & (1 << j)) > 0) {                   nb += pw[j];                   if (to_11[number][j] == an[j]) {                     ok = 0;                     break;                   }                 }               dp[i + 1][cur_mask][nb] = 1;               par[i + 1][cur_mask][nb] = prev_mask;             }     vector<int> v = {an[0], an[1], an[2], an[3], an[4]};     int number = to_number(v);     for (int mask = 0; mask < (1 << n); ++mask) {       if (dp[m][mask][number]) {         (void(1));         ;         vector<string> ans(n, string(m, 0));         int cur_mask = mask;         for (int i = m; i > 0; --i) {           for (int j = 0; j < n; ++j)             ans[j][i - 1] = (cur_mask & (1 << j)) > 0 ?  *  :  . ;           int prev_mask = par[i][cur_mask][number];           for (int j = 0; j < n; ++j)             if ((prev_mask & (1 << j)) == 0 && (cur_mask & (1 << j)) > 0) {               number -= pw[j];             }           cur_mask = prev_mask;         }         for (int i = 0; i < n; ++i) cout << ans[i] <<   n ;         return;       }     }     (void(1));     ;   }
#include <bits/stdc++.h>   using namespace std;   void magic() {     int n;     cin >> n;     int arr[n];     for (int i = 0; i < n; ++i) {       cin >> arr[i];     }     sort(arr, arr + n);     cout << min(arr[n - 1] - arr[1], arr[n - 2] - arr[0]) << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     magic();   }
#include <bits/stdc++.h>   using namespace std;   long long int is_prime[1000500];   int main() {     for (long long int i = 0; i < ((long long int)(1000500)); ++i)       if (2 <= i) is_prime[i] = true;     for (long long int i = 2; i * i < 1000500; i++) {       if (!is_prime[i]) continue;       for (long long int j = i * i; j < 1000500; j += i) is_prime[j] = false;     }     long long int a, b, k;     cin >> a >> b >> k;     queue<long long int> q;     long long int res = -1;     q.push(a - 1);     for (long long int pos = a; pos <= b; pos++) {       if (is_prime[pos]) q.push(pos);       while (k < ((long long int)(q).size())) q.pop();       if (((long long int)(q).size()) == k) res = max(res, pos - q.front() + 1);     }     if (q.front() == a - 1)       cout << -1 << endl;     else       cout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long volume[100001][2];   vector<long long> sell, buy;   int main() {     long long n, s;     cin >> n >> s;     for (long long i = 0; i < n; i++) {       char a;       long long b, c, d;       cin >> a >> b >> c;       if (a ==  B )         d = 1;       else         d = 0;       if (volume[b][d] == 0) {         if (d == 0)           sell.push_back(b);         else           buy.push_back(b);       }       volume[b][d] += c;     }     sort(buy.begin(), buy.end());     sort(sell.begin(), sell.end());     for (long long i = 0; i < s; i++) {       if (s - i - 1 < sell.size() && s - i - 1 >= 0)         cout <<  S   << sell[s - i - 1] <<     << volume[sell[s - i - 1]][0]              << endl;     }     for (long long i = 0; i < s; i++) {       if (buy.size() - i - 1 >= 0)         cout <<  B   << buy[buy.size() - i - 1] <<                  << volume[buy[buy.size() - i - 1]][1] << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   long long p[2007], hs[2007];   string q, w;   vector<int> k, st, st1, st2;   long long hashing(long long z, long long x) {     return (hs[x + 1] - hs[z]) * p[q.size() - x + 1];   }   void kmp_process() {     int g, h;     g = 0, h = -1, k[0] = -1;     while (g < w.length()) {       while (h >= 0 && w[g] != w[h]) h = k[h];       g++, h++;       k[g] = h;     }   }   void kmp_matching() {     int g, h;     g = h = 0;     while (g < q.length()) {       while (h >= 0 && q[g] != w[h]) h = k[h];       g++, h++;       if (h == w.length()) st.push_back(g - h), h = k[h];     }   }   int main() {     int g, h, f;     string a, s, as;     vector<long long> sst;     cin >> q >> a >> s;     w = a;     k.assign(2003, 0);     kmp_process();     kmp_matching();     st1 = st;     st.clear(), k.clear();     w = s;     k.assign(2003, 0);     kmp_process();     kmp_matching();     st2 = st;     st.clear();     for (g = 0; g < st2.size(); g++) st2[g] += (s.length() - 1);     p[0] = 1;     for (g = 1; g <= 2003; g++) {       p[g] = (p[g - 1] * 31);     }     for (g = 1; g <= q.length(); g++) {       hs[g] = hs[g - 1] + q[g - 1] * p[g];     }     long long xx = max(a.length(), s.length());     for (g = 0; g < st1.size(); g++) {       h = lower_bound(st2.begin(), st2.end(), st1[g]) - st2.begin();       for (; h < st2.size(); h++)         if (st2[h] - st1[g] + 1 >= xx) {           long long m = hashing(st1[g], st2[h]);           sst.push_back(m);         }     }     sort(sst.begin(), sst.end());     sst.erase(unique(sst.begin(), sst.end()), sst.end());     printf( %d n , sst.size());     return 0;   }