malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 2e4;   const int T = 24 * 60 * 60;   int was, n, M, add, cnt, ans[N];   vector<int> ind[T];   int main() {     scanf( %d%d%d , &n, &M, &add);     for (int i = 0; i < (int)(n); i++) {       int h, m, s;       scanf( %d:%d:%d , &h, &m, &s);       ind[s + 60 * (m + 60 * h)].push_back(i);     }     set<pair<int, int> > s;     for (int i = 0; i < (int)(T); i++) {       while ((int)(s).size() && s.begin()->first <= i) s.erase(s.begin());       for (int j : ind[i]) {         if ((int)(s).size() < M)           ans[j] = ++cnt;         else {           ans[j] = s.rbegin()->second;           s.erase(*s.rbegin());         }         s.insert(pair<int, int>(i + add, ans[j]));       }       was |= (int)(s).size() == M;     }     if (!was)       puts( No solution );     else {       printf( %d n , cnt);       for (int i = 0; i < (int)(n); i++) printf( %d n , ans[i]);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MOD = 998244353;   int sum(int a, int b) { return (a + b) % MOD; }   int prod(int a, int b) { return a * 1ll * b % MOD; }   int mpow(int b, int e) {     if (e == 0) return 1;     if (e & 1) return prod(b, mpow(b, e - 1));     return mpow(prod(b, b), e / 2);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0), cout.tie(0);     cout << fixed << setprecision(15);     const int HALF = mpow(2, MOD - 2);     int N;     cin >> N;     vector<vector<int> > adj(N);     for (int i = 0; i < N - 1; i++) {       int u, v;       cin >> u >> v;       adj[u - 1].push_back(v - 1);       adj[v - 1].push_back(u - 1);     }     int ans = 0;     function<int(int, int)> calc = [&](int loc, int par) {       int nm = 1;       for (int nbr : adj[loc]) {         if (nbr == par) continue;         int unv = calc(nbr, loc);         unv = sum(unv, prod(HALF, sum(1, MOD - unv)));         nm = prod(nm, unv);       }       nm = sum(1, MOD - nm);       ans = sum(ans, nm);       return nm;     };     calc(0, 0);     for (int i = 0; i < N; i++) ans = prod(ans, 2);     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n;     bool a = false;     cin >> n;     for (long long i = 1; i < n; i++) {       for (long long j = 1; j < n; j++) {         if (((n - i - j) % 3) != 0 && (i % 3) != 0 && (j % 3) != 0) {           cout << i <<     << j <<     << (n - i - j) << endl;           a = true;           break;         }       }       if (a) break;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int gi() {     int x = 0, w = 1;     char ch = getchar();     while ((ch <  0  || ch >  9 ) && ch !=  - ) ch = getchar();     if (ch ==  - ) w = 0, ch = getchar();     while (ch >=  0  && ch <=  9 )       x = (x << 3) + (x << 1) + ch -  0 , ch = getchar();     return w ? x : -x;   }   const int N = 3e5 + 5;   int q, fa[N + N], top;   pair<int, int> sz[N + N], sta[N];   map<pair<int, int>, int> M;   vector<pair<int, int> > vec[N << 2];   long long ans;   pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {     return make_pair(a.first + b.first, a.second + b.second);   }   pair<int, int> operator-(pair<int, int> a, pair<int, int> b) {     return make_pair(a.first - b.first, a.second - b.second);   }   int find(int x) { return x == fa[x] ? x : find(fa[x]); }   void modify(int x, int l, int r, int ql, int qr, pair<int, int> p) {     if (l >= ql && r <= qr) {       vec[x].push_back(p);       return;     }     int mid = l + r >> 1;     if (ql <= mid) modify(x << 1, l, mid, ql, qr, p);     if (qr > mid) modify(x << 1 | 1, mid + 1, r, ql, qr, p);   }   void dfs(int x, int l, int r) {     int tt = top;     for (pair<int, int> p : vec[x])       if (find(p.first) != find(p.second)) {         int u = find(p.first), v = find(p.second);         if (sz[u].first + sz[u].second < sz[v].first + sz[v].second) swap(u, v);         sta[++top] = make_pair(u, v);         ans -= 1ll * sz[u].first * sz[u].second;         ans -= 1ll * sz[v].first * sz[v].second;         fa[v] = u;         sz[u] = sz[u] + sz[v];         ans += 1ll * sz[u].first * sz[u].second;       }     if (l == r)       printf( %lld  , ans);     else {       int mid = l + r >> 1;       dfs(x << 1, l, mid);       dfs(x << 1 | 1, mid + 1, r);     }     while (top > tt) {       int u = sta[top].first, v = sta[top].second;       --top;       ans -= 1ll * sz[u].first * sz[u].second;       fa[v] = v;       sz[u] = sz[u] - sz[v];       ans += 1ll * sz[u].first * sz[u].second;       ans += 1ll * sz[v].first * sz[v].second;     }   }   int main() {     q = gi();     for (int i = 1; i <= q; ++i) {       int x = gi(), y = gi() + N;       if (M.find(make_pair(x, y)) == M.end())         M[make_pair(x, y)] = i;       else         modify(1, 1, q, M[make_pair(x, y)], i - 1, make_pair(x, y)),             M.erase(make_pair(x, y));     }     for (auto it = M.begin(); it != M.end(); ++it)       modify(1, 1, q, (*it).second, q, (*it).first);     for (int i = 1; i < N + N; ++i) fa[i] = i, sz[i] = make_pair(i < N, i >= N);     dfs(1, 1, q);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, s, k;   vector<int> a;   void Input() {     cin >> n >> s >> k;     a.clear();     a.resize(k);     for (auto &z : a) cin >> z;   }   void Solve() {     for (int i = 0; i <= k; i++) {       if (s - i >= 1 && find(a.begin(), a.end(), s - i) == a.end()) {         cout << i <<   n ;         return;       }       if (s + i <= n && find(a.begin(), a.end(), s + i) == a.end()) {         cout << i <<   n ;         return;       }     }     assert(false);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     int T;     cin >> T;     while (T--) {       Input();       Solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, i, j, a[102][102];     scanf( %d , &n);     ;     for (i = 0; i < n; i++) {       for (j = 0; j < n; j++) scanf( %d , &a[i][j]);       ;     }     if (i == 1) {       printf( 0 n );       return 0;     }     for (i = 0; i < n; i++) {       int f[32] = {0};       for (j = 0; j < n; j++) {         if (i == j) continue;         int x = a[i][j], c = 0;         while (x > 0) {           if (x & 1) f[c] = 1;           c++;           x /= 2;         }       }       int ans = 0, k;       j = 1;       for (k = 0; k < 32; k++) {         if (f[k]) ans += j;         j *= 2;       }       printf( %d  , ans);     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     int a[t];     for (int i = 0; i < t; i++) {       cin >> a[i];       if (360 % (180 - a[i]) == 0)         cout <<  YES  << endl;       else         cout <<  NO  << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void data() {}   const int N = 1e6 + 100;   const long long mod = 998244353;   const long long mod2 = 1e9 + 7;   map<int, int> was, was2;   int main() {     data();     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int a[n + 1];       for (int i = 1; i <= n; i++) {         cin >> a[i];       }       int len = 0;       for (int i = 1; i <= n - 1 && a[i] == 1; i++) {         len++;       }       if (len % 2 == 0) {         cout <<  First n ;       } else {         cout <<  Second n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   struct edge {     int u, v;     long long w;   };   long long MOD = 1000000007;   long long _MOD = 1000000009;   double EPS = 1e-10;   long long c[100][100];   long long C(long long n, long long k) {     if (n < 100) return c[n][k];     long long ans = 1;     for (int i = 0; i < k; i++) ans *= n - i;     for (int i = 1; i <= k; i++) ans /= i;     return ans;   }   class NumberMagic {    public:     int theMin(int _N, int _M) {       if (_N == 1) return 0;       for (int i = 0; i < 100; i++) {         c[i][0] = 1;         for (int j = 1; j <= i; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];       }       long long N = _N, M = _M;       long long lb = 0, ub = N - 1;       while (ub - lb > 1) {         long long mid = (lb + ub) / 2;         long long n = N, sum = 0;         for (long long k = 0; k <= mid && n; k++) {           long long unko = min(n, C(mid, k));           n -= unko;           sum += k * unko;         }         if (!n && sum <= mid * M)           ub = mid;         else           lb = mid;       }       return ub;     }   };   int main() {     NumberMagic nm;     int T;     cin >> T;     while (T--) {       int N, M;       cin >> N >> M;       cout << nm.theMin(N, M) << endl;     }   }
#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:256000000 )   using namespace std;   mt19937 ggen;   int n, s;   int a[200010];   int ctr[200010];   vector<int> v;   void solve() {     cin >> n >> s;     s--;     for (int i = 0; i < n; i++) cin >> a[i];     int ans = 0;     if (a[s] != 0) ans++;     for (int i = 0; i < n; i++) {       if (i != s) {         if (a[i] == 0) a[i] = 200009;         ctr[a[i]]++;         v.push_back(a[i]);       }     }     sort(v.begin(), v.end());     for (int i = 1; !v.empty() && i <= v.back(); i++) {       if (ctr[i] == 0) {         ans++;         ctr[v.back()]--;         v.pop_back();       }     }     cout << ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     ggen = mt19937(13);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = 1e4 + 7;   const long long INF = 1e18;   const int maxn = 6e5 + 5;   int n, m, k;   struct edge {     int to, cost;     edge() {}     edge(int to, int cost) : to(to), cost(cost) {}   };   vector<edge> G[maxn];   int d[maxn];   pair<int, int> p[maxn];   map<pair<int, int>, int> mp;   int dx[4] = {0, 0, 1, -1};   int dy[4] = {1, -1, 0, 0};   void dijkstra(int s) {     priority_queue<pair<int, int>, vector<pair<int, int> >,                    greater<pair<int, int> > >         q;     fill(d, d + maxn, 0x7fffffff);     d[s] = 0;     q.push(pair<int, int>(0, s));     while (!q.empty()) {       pair<int, int> p = q.top();       q.pop();       int v = p.second;       if (d[v] < p.first) continue;       for (int i = 0; i < G[v].size(); i++) {         edge e = G[v][i];         if (d[e.to] > d[v] + e.cost) {           d[e.to] = d[v] + e.cost;           q.push(pair<int, int>(d[e.to], e.to));         }       }     }   }   int main() {     cin >> n >> m >> k;     int dd = 1e4 + 5;     mp.clear();     for (int i = 1; i <= k; i++) {       int r, c;       scanf( %d%d , &r, &c);       G[i].push_back(edge(r + dd, 1));       G[i].push_back(edge(c + dd * 2, 1));       G[i].push_back(edge(r + 1 + dd, 1));       G[i].push_back(edge(r - 1 + dd, 1));       G[i].push_back(edge(c + dd * 2 + 1, 1));       G[i].push_back(edge(c + dd * 2 - 1, 1));       G[r + dd].push_back(edge(i, 0));       G[c + dd * 2].push_back(edge(i, 0));       G[r + 1 + dd].push_back(edge(i, 0));       G[r - 1 + dd].push_back(edge(i, 0));       G[c + dd * 2 + 1].push_back(edge(i, 0));       G[c + dd * 2 - 1].push_back(edge(i, 0));       p[i] = pair<int, int>(r, c);       mp[pair<int, int>(r, c)] = i;     }     for (int i = 1; i <= k; i++) {       for (int j = 0; j < 4; j++) {         int x = p[i].first + dx[j];         int y = p[i].second + dy[j];         if (mp.find(pair<int, int>(x, y)) != mp.end())           G[i].push_back(edge(mp[pair<int, int>(x, y)], 0));       }     }     if (mp.find(pair<int, int>(n, m)) == mp.end()) {       G[n + dd].push_back(edge(k + 1, 0));       G[m + 2 * dd].push_back(edge(k + 1, 0));     }     int ans;     dijkstra(mp[pair<int, int>(1, 1)]);     if (mp.find(pair<int, int>(n, m)) == mp.end()) {       ans = d[k + 1];     } else       ans = d[mp[pair<int, int>(n, m)]];     if (ans == 0x7fffffff) ans = -1;     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int a, b, c;     int f1, f2, s1, s2, t1, t2;     cin >> f1 >> f2 >> s1 >> s2 >> t1 >> t2;     int sum1 = f1 + s1 + t1;     a = f1;     b = s1;     c = t1;     n -= sum1;     if (n > 0) {       f2 = f2 - f1;       if (f2 < n) {         a += f2;         s2 = s2 - s1;         n -= f2;         if (s2 < n) {           b += s2;           t2 = t2 - t1;           n -= s2;           if (t2 < n)             c += t2;           else             c += n;         } else           b += n;       } else         a += n;     }     cout << a <<     << b <<     << c << endl;   }
#include <bits/stdc++.h>   using namespace std;   int a[105];   int main() {     int n, c, max = 0, t;     scanf( %d%d , &n, &c);     for (int i = 0; i < n; i++) scanf( %d , &a[i]);     for (int i = 0; i < n - 1; i++) {       t = a[i] - c;       if (t < 0)         continue;       else {         t -= a[i + 1];         if (t > max) max = t;       }     }     printf( %d n , max);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 1e5 + 10;   int main() {     int a, b, c;     while (cin >> a >> b >> c) {       int s[MAX] = {0};       s[a]++;       s[b]++;       s[c]++;       if (s[1] >= 1 || s[2] >= 2 || s[3] >= 3 || (s[2] == 1 && s[4] == 2))         printf( YES n );       else         printf( NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long MOD = 1000000000;   const int MAX = 100005;   const int RIGHT = 131072;   const int SIZE = 263000;   double L[MAX], R[MAX], T[SIZE];   int X[MAX], H[MAX], N, M;   pair<int, int> Mush[MAX];   void update(int l, int r, double p, int n, int a, int b) {     if (a > r || b < l) return;     if (a >= l && b <= r) {       T[n] *= p;       return;     }     int mid = (a + b) / 2;     update(l, r, p, 2 * n, a, mid);     update(l, r, p, 2 * n + 1, mid + 1, b);   }   double query(int x, int n, int a, int b) {     if (a > x || b < x) return 1.0;     if (a == b) return T[n];     int mid = (a + b) / 2;     return T[n] * query(x, 2 * n, a, mid) * query(x, 2 * n + 1, mid + 1, b);   }   int main() {     scanf( %d%d , &N, &M);     for (int i = (1); i <= (N); i++)       scanf( %d%d%lf%lf , &X[i], &H[i], &L[i], &R[i]);     for (int i = (1); i <= (N); i++) L[i] /= 100.0, R[i] /= 100.0;     for (int i = (1); i <= (M); i++)       scanf( %d%d , &Mush[i].first, &Mush[i].second);     sort(Mush + 1, Mush + 1 + M);     for (int i = (1); i <= (SIZE - 1); i++) T[i] = 1.0;     for (int i = (1); i <= (N); i++) {       int a, b;       a = lower_bound(Mush + 1, Mush + M + 1, make_pair(X[i] - H[i], 0)) - Mush;       b = lower_bound(Mush + 1, Mush + M + 1, make_pair(X[i], 0)) - Mush - 1;       update(a, b, 1.0 - L[i], 1, 1, RIGHT);       a = upper_bound(Mush + 1, Mush + M + 1, make_pair(X[i], 1000000005)) - Mush;       b = upper_bound(Mush + 1, Mush + M + 1,                       make_pair(X[i] + H[i], 1000000005)) -           Mush - 1;       update(a, b, 1.0 - R[i], 1, 1, RIGHT);     }     double ans = 0;     for (int i = (1); i <= (M); i++)       ans += query(i, 1, 1, RIGHT) * Mush[i].second;     cout << setprecision(15) << fixed << ans;   }
#include <bits/stdc++.h>   using namespace std;   const int N = (int)1e5 + 5, mod = (int)0;   int best[N], q[N];   int main() {     string s;     cin >> s;     int n = (int)s.size();     best[n] = 1e9;     for (int j = n - 1; j >= 0; --j) {       s[j] -=  a ;       best[j] = min(best[j + 1], (int)s[j]);     }     string res =   ;     int t = 0;     for (int j = 0; j < n; ++j) {       q[t++] = s[j];       while (t > 0 && q[t - 1] <= best[j + 1]) res += char(q[t - 1] +  a ), --t;     }     cout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   string nb;   int main() {     int N;     cin >> N;     cin >> nb;     string m;     m.append(N,  9 );     string act = nb;     for (int shift = 0; shift < N; shift++) {       for (int p = 0; p <= 9; p++) {         m = min(m, act);         for (int i = 0; i < N; i++) act[i] = ((act[i] -  0  + 1) % 10 +  0 );       }       char first = act[0];       for (int i = 1; i < N; i++) act[i - 1] = act[i];       act[N - 1] = first;     }     cout << m << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     long long n, m, l, a[100001], i, t = 0, p, d, k, w;     cin >> n >> m >> l;     for (i = 0; i < n; i++) cin >> a[i];     if (a[0] > l) t++;     for (i = 1; i < n; i++) {       if (a[i] > l && a[i - 1] <= l) t++;     }     for (i = 0; i < m; i++) {       cin >> k;       if (k == 0) {         cout << t << endl;       } else {         cin >> p >> d;         w = a[p - 1];         a[p - 1] += d;         if (p == 1) {           if (a[p] <= l && a[p - 1] > l && w <= l) t++;         } else if (p == n) {           if (a[p - 2] <= l && a[p - 1] > l && w <= l) t++;         } else {           if (a[p - 1] > l && a[p - 2] <= l && a[p] <= l && w <= l)             t++;           else if (a[p - 1] > l && a[p - 2] > l && a[p] > l && w <= l)             t--;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string b, b1, b2, e1, e2, e;     cin >> b1 >> b2 >> e1 >> e2;     swap(b2[0], b2[1]);     swap(e2[0], e2[1]);     b = b1 + b2;     e = e1 + e2;     b.erase(b.find( X ), 1);     e.erase(e.find( X ), 1);     if ((b + b).find(e) != string::npos) {       cout <<  YES ;     } else       cout <<  NO ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   struct EDGE {     int v, next;   };   EDGE w[222];   long long f[1 << 17], Y;   int ans[22], ww[22], visit[22], N, M, W = 0;   long long work() {     memset(f, 0, sizeof(f));     f[0] = 1;     for (int i = 0; i < 1 << N; ++i)       if (f[i]) {         if (i == 3) int asd = 1;         int u = 0;         for (int ii = i; ii; ii >>= 1) u += (ii & 1);         u++;         int sta = 1, end = N;         if (visit[u]) sta = end = visit[u];         for (int j = sta; j <= end; ++j)           if (!(i & (1 << j - 1))) {             bool flag = 1;             for (int k = ww[j]; k && flag; k = w[k].next)               if (i & (1 << w[k].v - 1)) flag = 0;             if (!flag) continue;             f[i | (1 << j - 1)] += f[i];           }       }     return f[(1 << N) - 1];   }   int main() {     scanf( %d%I64d%d , &N, &Y, &M);     Y -= 2000;     for (int i = 1, u, v; i <= M; ++i) {       scanf( %d%d , &u, &v);       w[++W].v = v;       w[W].next = ww[u];       ww[u] = W;     }     if (work() < Y) {       puts( The times have changed );       exit(0);     }     for (int i = 1; i <= N; ++i) {       for (int j = 1; j <= N; ++j)         if (!visit[j]) {           visit[j] = i;           long long now = work();           if (now >= Y) {             ans[i] = j;             break;           }           Y -= now;           visit[j] = 0;         }     }     for (int i = 1; i <= N; ++i) printf( %d%c , ans[i], (i == N ?   n  :    ));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int t;     cin >> t;     bool flag;     while (t--) {       int n;       cin >> n;       long long int a[n];       for (int i = 0; i < n; i++) cin >> a[i];       flag = true;       sort(a, a + n);       long long int k = a[0] * a[n - 1], tmp;       for (int i = 0; i < n; i++) {         tmp = a[i] * a[n - 1 - i];         if (tmp != k) flag = false;       }       int ptr = 0;       if (flag) {         for (int i = 2; i <= sqrt(k); i++) {           if (k % i == 0) {             if (a[ptr] == i)               ptr++;             else {               flag = false;               break;             }           }         }       }       if (flag)         cout << k << endl;       else         cout << -1 << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   using VV = vector<vector<T>>;   template <class T>   inline T SMIN(T& a, const T b) {     return a = (a > b) ? b : a;   }   template <class T>   inline T SMAX(T& a, const T b) {     return a = (a < b) ? b : a;   }   template <class Iter>   void dumpc(Iter begin, Iter end) {     if (false) {       for (; begin != end; ++begin) {         cerr << *begin <<  , ;       }       cerr << endl;     }   }   int Q;   map<int, int> comp;   int getid(int a) {     if (comp.count(a)) return comp[a];     comp[a] = int((comp).size());     return comp[a];   }   struct UF {    public:     int groupNum;     vector<int> X;     UF(int N) {       uf = vector<int>(N);       rank = vector<int>(N);       X = vector<int>(N);       for (int i = 0; i < N; ++i) uf[i] = i, rank[i] = 0;       groupNum = N;     }     pair<int, int> find(int v) {       int cur = 0;       while (uf[v] != v) {         cur ^= X[v];         v = uf[v];       }       return {v, cur};     }     bool same(int x, int y) { return find(x) == find(y); }     void unite(int x, int y, int z) {       auto px = find(x);       auto py = find(y);       if (px.first == py.first) return;       groupNum--;       x = px.first, y = py.first;       z = px.second ^ py.second ^ z;       if (rank[x] == rank[y]) {         uf[x] = y;         X[x] = z;         rank[y]++;         return;       }       if (rank[x] < rank[y]) {         uf[x] = y;         X[x] = z;       } else {         uf[y] = x;         X[y] = z;         if (rank[x] == rank[y]) ++rank[x];       }     }       private:     vector<int> rank;     vector<int> uf;   };   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cin >> Q;     UF uf(2 * Q + 10);     int last = 0;     while (Q--) {       int t, l, r;       cin >> t >> l >> r;       l ^= last, r ^= last;       if (l > r) swap(l, r);       ++r;       if (false) {         cerr <<  l               <<   =   << (l) <<  ,                <<  r               <<   =   << (r) <<  ,                <<  getid(l)               <<   =   << (getid(l)) <<  ,                <<  getid(r)               <<   =   << (getid(r)) << endl;       };       l = getid(l), r = getid(r);       if (t == 1) {         int x;         cin >> x;         x ^= last;         uf.unite(l, r, x);       } else {         pair<int, int> p1 = uf.find(l), p2 = uf.find(r);         if (false) {           cerr <<  p1.first                 <<   =   << (p1.first) <<  ,                  <<  p2.first                 <<   =   << (p2.first) << endl;         };         if (p1.first != p2.first) {           last = 1;           fprintf(stdout,  %d , -1), putchar(  n );           ;         } else {           if (false) {             cerr <<  Q                   <<   =   << (Q) <<  ,                    <<  p1.second                   <<   =   << (p1.second) <<  ,                    <<  p2.second                   <<   =   << (p2.second) << endl;           };           last = p1.second ^ p2.second;           fprintf(stdout,  %d , last), putchar(  n );           ;         }       }     }     return 0;   }