malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 10, mod = 1e9 + 7;   int n, K, ans, cnt;   char s[5];   struct DSU {     int fa[N];     bool mark[N];     int getfa(int x) { return fa[x] == x ? x : fa[x] = getfa(fa[x]); }     bool merge(int x, int y) {       int fx = getfa(x), fy = getfa(y);       if (getfa(x ^ 1) == fy || getfa(y ^ 1) == fx) return 0;       if (fx != fy) fa[fx] = fy;       return 1;     }     bool Set(int l, int r, int c) {       if (!c)         return merge(l * 2, r * 2) && merge(l * 2 + 1, r * 2 + 1);       else         return merge(l * 2 + 1, r * 2) && merge(l * 2, r * 2 + 1);     }   } T;   int qpow(int a, int b) {     int ret = 1;     for (; b; b >>= 1) {       if (b & 1) ret = 1ll * ret * a % mod;       a = 1ll * a * a % mod;     }     return ret;   }   int main() {     cin >> n >> K;     for (int i = 0; i <= (n + 2) * 2; i++) T.fa[i] = i;     for (int i = 1; i <= K; i++) {       int x, y;       scanf( %d%d%s , &x, &y, s + 1);       --x, --y;       int l = x - y, r = x + y;       if (l < 0) l = -l;       if (r > n - 1) r = (n - 1) * 2 - r;       if (!T.Set(l, r + 2, s[1] ==  o )) {         return puts( 0 ), 0;       }     }     for (int i = 0; i <= (n + 1) * 2 + 1; i++) ans += (T.getfa(i) == i);     printf( %d n , qpow(2, ans / 2 - 2));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 100005;   const double eps = 1e-9;   const double pi = acos(-1);   struct P {     int x, y;   } a[N];   int n, vi[N], t[N];   double l[N], r[N], q[N];   long long k;   void change(int k, int v) {     for (; k; k -= k & (-k)) t[k] += v;   }   int ask(int k) {     int s = 0;     for (; k < N; k += k & (-k)) s += t[k];     return s;   }   struct node {     double p1, p2;     int v;   } op[N * 2];   bool cmp(node a, node b) { return a.p1 < b.p1; }   long long count(double R) {     int top = 0, op_top = 0;     memset(t, 0, sizeof(t));     for (int i = (int)(1); i <= (int)(n); i++) {       l[i] = r[i] = -1;       double d = sqrt(a[i].x * a[i].x + a[i].y * a[i].y);       if (d < R + eps) continue;       double theta = atan2(a[i].y, a[i].x);       double delta = acos(R / d);       l[i] = theta - delta;       r[i] = theta + delta;       for (; l[i] < 0; l[i] += 2 * pi)         ;       for (; r[i] < 0; r[i] += 2 * pi)         ;       for (; l[i] >= 2 * pi; l[i] -= 2 * pi)         ;       for (; r[i] >= 2 * pi; r[i] -= 2 * pi)         ;       if (l[i] > r[i]) swap(l[i], r[i]);       q[++top] = l[i];       op[++op_top] = (node){l[i], l[i], 1};       op[++op_top] = (node){r[i], l[i], -1};     }     sort(q + 1, q + top + 1);     sort(op + 1, op + op_top + 1, cmp);     long long sum = 0;     for (int i = (int)(1); i <= (int)(op_top); i++) {       int p = lower_bound(q + 1, q + top + 1, op[i].p2) - q;       change(p, op[i].v);       if (op[i].v == -1) sum += ask(p);     }     return sum;   }   int main() {     scanf( %d%lld , &n, &k);     for (int i = (int)(1); i <= (int)(n); i++) scanf( %d%d , &a[i].x, &a[i].y);     double l = 0, r = 15000;     for (int T = (int)(1); T <= (int)(50); T++) {       double mid = (l + r) / 2;       if (1ll * n * (n - 1) / 2 - count(mid) < k)         l = mid;       else         r = mid;     }     printf( %.10lf n , (l + r) / 2);   }
#include <bits/stdc++.h>   #pragma warning(disable : 4996)   using namespace std;   int n;   long long a[1005][2];   long long mi = ((1ll << 62) - 1);   void calc(long long x) {     int i;     long long sum = 0;     int cnt = 0;     vector<pair<int, int> > v;     for (i = 0; i < n; i++) {       if (a[i][0] <= x && a[i][1] <= x) {         if (a[i][0] <= a[i][1])           sum += a[i][0];         else           v.push_back(pair<int, int>(a[i][1] - a[i][0], i));       } else if (a[i][0] <= x)         sum += a[i][1], cnt++;       else if (a[i][1] <= x)         sum += a[i][0];       else         return;     }     if (cnt > n / 2) return;     sort(v.begin(), v.end());     for (auto e : v) {       if (cnt < n / 2)         sum += a[e.second][1], cnt++;       else         sum += a[e.second][0];     }     mi = min(mi, x * sum);   }   int main() {     int i, j, k;     cin >> n;     for (i = 0; i < n; i++)       for (j = 0; j < 2; j++) cin >> a[i][j];     for (i = 0; i < n; i++)       for (j = 0; j < 2; j++) calc(a[i][j]);     cout << mi;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void reverse_(vector<int> num) {     vector<int> a;     for (int i = num.size() - 1; i > -1; i--) a.push_back(num[i]);     num = a;   }   int main() {     int n, x;     cin >> n >> x;     vector<int> num(n), used(1e5 + 7, 0), step(1e5 + 7, 1e9);     set<int> all;     for (int i = 0; i < n; i++) {       cin >> num[i];       used[num[i]] = 1;       all.insert(num[i]);     }     if (all.size() < n) {       cout <<  0 n ;       return 0;     }     int ans = 1e9;     sort(num.begin(), num.end());     reverse_(num);     for (int i = 0; i < n; i++) {       int now = num[i];       int prev = -1;       int shag = 0;       while (now >= 0 && prev != now) {         if (now != num[i]) {           if (used[now]) {             ans = min(ans, shag);           }         }         if (step[now] != 1e9) {           ans = min(step[now] + shag, ans);         }         step[now] = min(step[now], shag);         prev = now;         now = now & x;         shag++;       }     }     if (ans == 1e9) {       cout <<  -1 n ;       return 0;     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m;     cin >> n;     long long p[n], y;     set<long long> c[4];     set<long long>::iterator it;     c[1].insert(-1);     c[2].insert(-1);     c[3].insert(-1);     int temp;     for (int i = 0; i < n; i++) cin >> p[i];     for (int i = 0; i < n; i++) {       cin >> temp;       c[temp].insert(p[i]);     }     for (int i = 0; i < n; i++) {       cin >> temp;       c[temp].insert(p[i]);     }     cin >> m;     for (int i = 0; i < m; i++) {       cin >> temp;       it = c[temp].begin();       it++;       if (it == c[temp].end()) {         cout <<  -1  ;         continue;       } else {         y = *it;         cout << y <<    ;       }       c[1].erase(y);       c[2].erase(y);       c[3].erase(y);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int edge[510][510], vis[510], con, N, M, f, t;   void dfs(int x) {     vis[x] = 1;     for (int i = 1; i <= N; i++)       if (edge[x][i]) {         if (!vis[i])           dfs(i);         else if (vis[i] == 1)           con++;         if (con >= 2) break;       }     vis[x] = 2;   }   int main() {     scanf( %d%d , &N, &M);     for (int i = 1; i <= M; i++) {       scanf( %d%d , &f, &t);       edge[f][t] = 1;     }     for (int i = 1; i <= N; i++) {       con = 0;       memset(vis, 0, sizeof vis);       dfs(i);       for (int j = 1; j <= N; j++)         if (j != i) {           if (!vis[j]) dfs(j);           if (con >= 2) break;         }       if (con <= 1) return puts( YES ), 0;     }     return puts( NO ), 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, i, g, a[100001], p[100001], maxi;     vector<long long> v;     cin >> n;     for (i = 0; i < n; i++) {       cin >> a[i];       p[a[i]] = i + 1;     }     g = 1;     for (i = 1; i < n; i++) {       if (p[i] <= p[i + 1]) {         g++;       } else {         v.push_back(g);         g = 1;       }     }     v.push_back(g);     maxi = 0;     for (i = 0; i < v.size(); i++) {       maxi = max(maxi, v[i]);     }     cout << n - maxi;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 100005;   int n, i, j, k, cnt, tot, f[maxn];   char s[maxn];   int main() {     scanf( %d%s , &n, s + 1);     if (n & 1) return puts( 0 ), 0;     tot = n >> 1;     f[0] = 1;     for (i = 1; i <= n; i++) {       if (s[i] ==  ? )         for (j = i >> 1, k = max(1, tot - (n - i)); j >= k; j--)           f[j] = f[j] + f[j - 1];       else         cnt++;     }     if (cnt > tot) return puts( 0 ), 0;     int ans = f[tot];     for (i = tot - cnt; i; i--) ans *= 25;     printf( %u , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int a[n];       for (int i = 0; i < n; i++) {         cin >> a[i];       }       sort(a, a + n);       int count = 0;       int groups = 0;       for (int i = 0; i < n; i++) {         if (++count == a[i]) {           count = 0;           groups++;         }       }       cout << groups << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T checkmin(T &a, T b) {     return (a < b) ? a : a = b;   }   template <class T>   inline T checkmax(T &a, T b) {     return (a > b) ? a : a = b;   }   template <class T>   T GCD(T a, T b) {     if (a < 0) return GCD(-a, b);     if (b < 0) return GCD(a, -b);     return (a == 0) ? b : GCD(b % a, a);   }   template <class T>   T LCM(T a, T b) {     if (a < 0) return LCM(-a, b);     if (b < 0) return LCM(a, -b);     return (a == 0 || b == 0) ? 0 : a / GCD(a, b) * b;   }   template <class T>   inline T sqr(T X) {     return X * X;   }   namespace Poor {   const int MaxiN = 105;   const long long Infinity = 2000000000000000000LL;   int N, M;   long long K;   int C[MaxiN][MaxiN];   int Weight[MaxiN + MaxiN];   pair<int, int> List[MaxiN + MaxiN];   char St[MaxiN + MaxiN];   inline void Inc(long long &a, long long b) {     a += b;     if (a > Infinity) a = Infinity;   }   long long DP() {     map<int, long long> Now, Suc;     Now.clear();     Now[0] = 1;     for (int i = 0; i < N + M - 1; ++i) {       for (typeof(Now.begin()) it = Now.begin(); it != Now.end(); ++it) {         if (St[i] !=  ) ) Inc(Suc[it->first + 1], it->second);         if (St[i] !=  (  && it->first > 0) Inc(Suc[it->first - 1], it->second);       }       Now = Suc;       Suc.clear();     }     return Now[0];   }   void Run() {     cin >> N >> M >> K;     for (int i = 0; i < N; ++i)       for (int j = 0; j < M; ++j) cin >> C[i][j];     fill(Weight, Weight + N + M - 1, INT_MAX);     for (int i = 0; i < N; ++i)       for (int j = 0; j < M; ++j) checkmin(Weight[i + j], C[i][j]);     for (int i = 0; i < N + M - 1; ++i) List[i] = make_pair(Weight[i], i);     sort(List, List + N + M - 1);     fill(St, St + N + M - 1,  ? );     for (int i = 0; i < N + M - 1; ++i) {       int p = List[i].second;       St[p] =  ( ;       long long dp = DP();       if (dp < K) {         K -= dp;         St[p] =  ) ;       }     }     for (int i = 0; i < N; ++i) {       for (int j = 0; j < M; ++j) putchar(St[i + j]);       puts(  );     }   }   }  // namespace Poor   int main() {     Poor::Run();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[7][7][101];   int d[101], t[7];   char cd[101];   bool dfs(int now, int saw, int n) {     if (saw == n) return true;     for (int i = 0; i < 7; i++)       if (a[now][i][0] > 0) {         d[saw] = a[now][i][a[now][i][0]];         cd[saw] =  + ;         a[now][i][0]--;         if (dfs(i, saw + 1, n)) return true;         a[now][i][0]++;       }     for (int i = 0; i < 7; i++)       if (a[i][now][0] > 0) {         d[saw] = a[i][now][a[i][now][0]];         cd[saw] =  - ;         a[i][now][0]--;         if (dfs(i, saw + 1, n)) return true;         a[i][now][0]++;       }     return false;   }   int main() {     int n;     cin >> n;     for (int i = 0; i < n; i++) {       int v1, v2;       cin >> v1 >> v2;       a[v1][v2][0]++;       a[v1][v2][a[v1][v2][0]] = i + 1;       t[v1]++;       t[v2]++;     }     int odd1 = -1, odd2 = -1;     for (int i = 0; i < 7; i++)       if (t[i] % 2 == 1) {         if (odd2 != -1) {           cout <<  No solution n ;           return 0;         } else if (odd1 == -1)           odd1 = i;         else           odd2 = i;       }     if (odd1 != -1 && odd2 == -1) {       cout <<  No solution n ;       return 0;     }     if (odd1 != -1) {       if (dfs(odd1, 0, n)) {         for (int i = 0; i < n; i++) cout << d[i] <<     << cd[i] << endl;         return 0;       } else {         cout <<  No solution n ;         return 0;       }     } else {       for (int i = 0; i < 7; i++)         if (t[i] > 0) {           if (dfs(i, 0, n)) {             for (int j = 0; j < n; j++) cout << d[j] <<     << cd[j] << endl;             return 0;           } else {             cout <<  No solution n ;             return 0;           }         }       cout <<  No solution n ;       return 0;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long mod = 1000000009;   int n, m, k;   class Mat {    public:     long long e[2][2];     Mat mul(Mat u) {       Mat s;       for (int i = 0; i < 2; i++) {         for (int j = 0; j < 2; j++) {           s.e[i][j] = 0;           for (int k = 0; k < 2; k++) {             s.e[i][j] += e[i][k] * u.e[k][j];             s.e[i][j] %= mod;           }         }       }       return s;     }     Mat powMat(Mat u, int k) {       Mat mat;       memset(mat.e, 0, sizeof(mat.e));       mat.e[0][0] = 1;       mat.e[1][1] = 1;       while (k) {         if (k & 1) {           mat = mat.mul(u);         }         u = u.mul(u);         k = (k >> 1);       }       return mat;     }   };   bool good(int mid) {     int n1 = n - mid * k;     int m1 = m - mid * k;     int ans = n1 / k * (k - 1) + n1 % k;     if (ans >= m1) return true;     return false;   }   int main() {     scanf( %d%d%d , &n, &m, &k);     int l = 0, r = m / k;     int mid;     while (l < r) {       mid = (l + r) / 2;       if (good(mid))         r = mid;       else         l = mid + 1;     }     Mat u;     u.e[0][0] = (long long)k;     u.e[0][1] = 1L;     u.e[1][0] = 0;     u.e[1][1] = 0;     Mat v;     v.e[0][0] = 2L;     v.e[0][1] = 0;     v.e[1][0] = (long long)k;     v.e[1][1] = 1L;     u = u.mul(v.powMat(v, l));     long long ans = (u.e[0][0] - k + (m - l * k) + mod) % mod;     cout << ans;     return 0;   }
#include <bits/stdc++.h>   const double eps = 1e-10;   int n, a, b, cnta[100010], cntb[100010];   double p[100010], q[100010], f[100010];   void check2(double costa, double costb) {     for (int i = 1; i <= n; i++) {       f[i] = 0;       cnta[i] = 0;       cntb[i] = 0;       f[i] = f[i - 1];       cnta[i] = cnta[i - 1];       cntb[i] = cntb[i - 1];       if (f[i] < f[i - 1] + p[i] - costa - eps) {         f[i] = f[i - 1] + p[i] - costa;         cnta[i] = cnta[i - 1] + 1;         cntb[i] = cntb[i - 1];       }       if (f[i] < f[i - 1] + q[i] - costb - eps) {         f[i] = f[i - 1] + q[i] - costb;         cnta[i] = cnta[i - 1];         cntb[i] = cntb[i - 1] + 1;       }       if (f[i] < f[i - 1] + p[i] - costa + q[i] - costb - p[i] * q[i] - eps) {         f[i] = f[i - 1] + p[i] - costa + q[i] - costb - p[i] * q[i];         cnta[i] = cnta[i - 1] + 1;         cntb[i] = cntb[i - 1] + 1;       }     }   }   double check1(double cost) {     double l = 0, r = 1, mid;     for (int i = 1; i <= 50; i++) {       mid = (l + r) / 2;       check2(cost, mid);       if (cntb[n] > b)         l = mid;       else         r = mid;     }     return l;   }   double l, r, mid, v, ans;   int main() {     scanf( %d %d %d , &n, &a, &b);     for (int i = 1; i <= n; i++) scanf( %lf , p + i);     for (int i = 1; i <= n; i++) scanf( %lf , q + i);     l = 0;     r = 1;     while (r - l > eps) {       mid = (l + r) / 2.0;       v = check1(mid);       if (cnta[n] > a)         l = mid;       else         r = mid;     }     check2(l, v);     printf( %.10lf n , f[n] + l * a + v * b);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using s64 = long long;   const int M = 1000000007;   int add(int a, const int &b) {     a += b;     return a >= M ? a - M : a;   }   int sub(int a, const int &b) {     a -= b;     return a < 0 ? a + M : a;   }   int mul(const int &a, const int &b) { return (s64)a * b % M; }   int main() {     int n, k;     cin >> n >> k;     vector<int> fac(n), ifac(n);     fac[0] = fac[1] = ifac[0] = ifac[1] = 1;     for (int i = 2; i < n; ++i) {       fac[i] = mul(fac[i - 1], i);       ifac[i] = mul(M - M / i, ifac[M % i]);     }     for (int i = 2; i < n; ++i) {       ifac[i] = mul(ifac[i], ifac[i - 1]);     }     vector<int> f(n + 1), sum(n + 1);     for (int i = k + 1; i <= n; ++i) {       f[i] = mul(add(i - k - 1, sub(sum[i - 1], sum[i - k - 1])), fac[i - 2]);       sum[i] = mul(f[i], ifac[i - 1]);       sum[i] = add(sum[i], sum[i - 1]);     }     int answer = 0;     for (int i = 1; i <= n; ++i) {       answer = add(answer, mul(f[i], mul(fac[n - 1], ifac[i - 1])));     }     cout << answer << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long N = 1e9 + 7;   map<long long, long long> factorize(long long n) {     map<long long, long long> ans;     for (long long i = 2; i * i <= n; i++) {       while (n % i == 0) {         ans[i]++;         n /= i;       }     }     if (n > 1) {       ans[n]++;       n = 1;     }     return ans;   }   void FAST() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);   }   long long binpow(long long a, long long b, long long m) {     a %= m;     long long res = 1;     while (b > 0) {       if (b & 1) res = res * a % m;       a = a * a % m;       b >>= 1;     }     return res;   }   int main() {     FAST();     long long t;     cin >> t;     while (t--) {       long long x;       cin >> x;       long long y;       cin >> y;       long long k;       cin >> k;       long long reqy = y * k;       if ((k * (y + 1) - 1) % (x - 1)) {         cout << (k * (y + 1) - 1) / (x - 1) + k + 1 <<   n ;       } else         cout << (k * (y + 1) - 1) / (x - 1) + k <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   const int infi = 1e9 + 7;   const long long infl = (long long)1e18 + (long long)7;   const long long mod = 998244353;   long long sum[300500];   long long get_sum(int l, int r) {     if (l > r) {       return 0;     }     if (l) {       return sum[r] - sum[l - 1];     }     return sum[r];   }   long long ar[300500];   long long pow(long long a, long long p) {     long long ans = 1;     while (p) {       if (p & 1LL) {         ans *= a;         ans %= mod;       }       a *= a;       a %= mod;       p >>= 1;     }     return ans;   }   long long norm(long long a, long long n) { return (a * pow(n, mod - 2)) % mod; }   int32_t main() {     cin.sync_with_stdio(false);     cin.tie(0);     int n;     cin >> n;     for (int i = 0; i < (n); ++i) {       cin >> ar[i];     }     sort(ar, ar + n);     reverse(ar, ar + n);     for (int i = 0; i < (n); ++i) {       if (i) sum[i] = sum[i - 1];       sum[i] += ar[i];       sum[i] %= mod;     }     for (int len = 1; len < n; ++len) {       long long ans = 0;       for (long long w = 1, l = len; l < n; l += len, ++w) {         long long r = min(l + len - 1, n - 1LL);         ans += get_sum(l, r) * w;         ans %= mod;       }       if (ans < 0) ans += mod;       cout << norm(ans, n) <<    ;     }     cout << 0 << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long a[1000000], m, n, i, j, k, l, ma, mi;   int main() {     cin >> n;     for (i = 1; i <= n; i++) cin >> a[i];     if (n <= 2) {       cout << -1 << endl;       return 0;     }     for (i = 1; i <= n - 2; i++)       if (a[i] != a[i + 2]) {         if (a[i] == a[i + 1]) {           cout << i + 1 <<     << i + 2 << endl;           return 0;         } else if (a[i + 1] == a[i + 2]) {           cout << i <<     << i + 1 << endl;           return 0;         } else {           if (a[i] > a[i + 1] && a[i] > a[i + 2])             ma = i;           else if (a[i + 1] > a[i] && a[i + 1] > a[i + 2])             ma = i + 1;           else             ma = i + 2;           if (a[i] < a[i + 1] && a[i] < a[i + 2])             mi = i;           else if (a[i + 1] < a[i] && a[i + 1] < a[i + 2])             mi = i + 1;           else             mi = i + 2;           if (ma != i + 1) {             if (ma != i + 2)               cout << i <<     << i + 1 << endl;             else               cout << i + 2 <<     << i + 1 << endl;             return 0;           }           if (mi != i + 1) {             if (mi != i + 2)               cout << i <<     << i + 1 << endl;             else               cout << i + 2 <<     << i + 1 << endl;             return 0;           }         }       }     if (n == 3 && a[1] == a[3]) {       cout << -1 << endl;       return 0;     } else if (a[1] != a[2])       cout << 1 <<     << 2 << endl;     else       cout << -1 << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     bitset<30> a;     bitset<30> b;     a.reset();     b.reset();     bool bigger = 0;     cout <<  ? 0 0  << endl;     fflush(stdout);     int aa;     cin >> aa;     if (aa == -1) {       bigger = 1;     }     bitset<30> adda;     bitset<30> addb;     for (int i = 29; i >= 0; i--) {       adda[i] = 1;       addb[i] = 1;       cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;       fflush(stdout);       int aa;       cin >> aa;       if (aa == -1 && bigger == 0) {         a[i] = 1;         b[i] = 0;         adda[i] = 0;         addb[i] = 1;         cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;         fflush(stdout);         int aa;         cin >> aa;         if (aa == -1) {           bigger = 1;         }       } else if (aa == 1 && bigger == 1) {         a[i] = 0;         b[i] = 1;         adda[i] = 1;         addb[i] = 0;         cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;         fflush(stdout);         int aa;         cin >> aa;         if (aa == 1) {           bigger = 0;         }       } else if (aa == 1 && bigger == 0) {         adda[i] = 1;         addb[i] = 0;         cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;         fflush(stdout);         int aa;         cin >> aa;         if (aa == 1) {           a[i] = 0;           b[i] = 0;           adda[i] = 0;           addb[i] = 0;         } else if (aa == -1) {           a[i] = 1;           b[i] = 1;           adda[i] = 1;           addb[i] = 1;         }       } else if (aa == -1 && bigger == 1) {         adda[i] = 0;         addb[i] = 1;         cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;         fflush(stdout);         int aa;         cin >> aa;         if (aa == -1) {           a[i] = 0;           b[i] = 0;           adda[i] = 0;           addb[i] = 0;         } else if (aa == 1) {           a[i] = 1;           b[i] = 1;           adda[i] = 1;           addb[i] = 1;         }       } else if (aa == 0) {         adda[i] = 0;         addb[i] = 1;         cout <<  ?   << adda.to_ulong() <<     << addb.to_ulong() << endl;         fflush(stdout);         int aa;         cin >> aa;         if (aa == -1) {           a[i] = 0;           b[i] = 0;           adda[i] = 0;           addb[i] = 0;         } else if (aa == 1) {           a[i] = 1;           b[i] = 1;           adda[i] = 1;           addb[i] = 1;         }       }     }     cout <<  !   << a.to_ulong() <<     << b.to_ulong() << endl;     fflush(stdout);   }