malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   long long a[(200020)], b[(200020)], close[100][2];   set<pair<long long, long long> > vis;   signed main() {     long long n;     cin >> n;     for (long long i = 1; i <= n; i++) scanf( %lld , &a[i]);     for (long long i = 1; i <= n; i++) b[i] = b[i - 1] + a[i];     long long ans = 0;     for (long long i = 1; i <= n; i++) {       if (i >= 3)         for (long long k = 0; k < 30; k++)           if (!(a[i] & (1 << k))) {             if (close[k][0] && i - close[k][0] > 1) {               if ((a[i] ^ a[close[k][0]]) == b[i - 1] - b[close[k][0]]) {                 if (vis.find(make_pair(close[k][0], i)) != vis.end()) continue;                 ans++;                 vis.insert(make_pair(close[k][0], i));               }             }             if (close[k][1] && i - close[k][1] > 1) {               if ((a[i] ^ a[close[k][1]]) == b[i - 1] - b[close[k][1]]) {                 if (vis.find(make_pair(close[k][1], i)) != vis.end()) continue;                 ans++;                 vis.insert(make_pair(close[k][1], i));               }             }           }       for (long long k = 0; k < 30; k++) {         if (a[i] & (1 << k)) {           close[k][1] = close[k][0];           close[k][0] = i;         }       }     }     memset(close, 0, sizeof(close));     for (long long i = n; i >= 1; i--) {       if (n - i + 1 >= 3)         for (long long k = 0; k < 30; k++)           if (!(a[i] & (1 << k))) {             if (close[k][0] && close[k][0] - i > 1) {               if ((a[i] ^ a[close[k][0]]) == b[close[k][0] - 1] - b[i]) {                 if (vis.find(make_pair(i, close[k][0])) != vis.end()) continue;                 ans++;                 vis.insert(make_pair(i, close[k][0]));               }             }             if (close[k][1] && close[k][1] - i > 1) {               if ((a[i] ^ a[close[k][1]]) == b[close[k][1] - 1] - b[i]) {                 if (vis.find(make_pair(i, close[k][1])) != vis.end()) continue;                 ans++;                 vis.insert(make_pair(i, close[k][1]));               }             }           }       for (long long k = 0; k < 30; k++) {         if (a[i] & (1 << k)) {           close[k][1] = close[k][0];           close[k][0] = i;         }       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, s, i, j, k, a, b, w, l1, l2, c, rt, lw;   double v[109][109], t[109][109], tp, tc, p1, p2, t1, t2;   int main() {     cin >> n >> s;     for (i = 0; i < n; i++) {       cin >> k;       for (j = 0; j < k; j++) cin >> v[i][j] >> t[i][j];       t[i][k] = 9999999.0;     }     for (i = 0; i < n; i++) {       for (j = i + 1; j < n; j++) {         p1 = p2 = 0.0;         w = lw = c = 0;         t1 = t[i][0];         t2 = t[j][0];         for (l1 = l2 = 0;;) {           a = b = 0;           if (t1 > t2) {             tc = t2;             b = 1;           } else {             if (t1 < t2) {               tc = t1;               a = 1;             } else {               tc = t1;               a = b = 1;             }           }           t1 -= tc;           t2 -= tc;           p1 += v[i][l1] * tc;           p2 += v[j][l2] * tc;           if (w == 0) {             if (p1 > p2) {               w = 1;               if (lw == 2) c++;             }             if (p1 < p2) {               w = 2;               if (lw == 1) c++;             }           } else {             if (w == 1) {               if (p1 < p2) {                 c++;                 w = 2;               }               if (p1 == p2) lw = 1, w = 0;             } else {               if (p1 > p2) {                 c++;                 w = 1;               }               if (p1 == p2) lw = 2, w = 0;             }           }           if (a == 1) {             l1++;             t1 = t[i][l1];           }           if (b == 1) {             l2++;             t2 = t[j][l2];           }           if (p1 >= s || p2 >= s) break;         }         rt += c;       }     }     cout << rt;   }
#include <bits/stdc++.h>   int main(void) {     double a, v, l, d, w, t = 0;     scanf( %lf%lf%lf%lf%lf , &a, &v, &l, &d, &w);     if (2 * a * d <= w * w || w >= v) {       if (l * a * 2 >= v * v) {         t += v / a;         t += (l - v * v / (2 * a)) / v;       } else {         t += sqrt(2 * l / a);       }     } else if (2 * a * d >= 2 * v * v - w * w) {       t += v / a;       t += (v - w) / a;       t += (d - (2 * v * v - w * w) / (2 * a)) / v;       if (2 * a * (l - d) > v * v - w * w) {         t += (v - w) / a;         t += (l - d - (v * v - w * w) / (2 * a)) / v;       } else {         t += sqrt(2 * (l - d) / a + w * w / (a * a)) - w / a;       }     } else {       t += (sqrt(a * d + w * w / 2) + sqrt(a * d + w * w / 2) - w) / a;       if (2 * a * (l - d) > v * v - w * w) {         t += (v - w) / a;         t += (l - d - (v * v - w * w) / (2 * a)) / v;       } else {         t += sqrt(2 * (l - d) / a + w * w / (a * a)) - w / a;       }     }     printf( %f n , t);     return 0;   }
#include <bits/stdc++.h>   int main() {     int t;     scanf( %d , &t);     while (t--) {       long long int n, k;       scanf( %lld %lld , &n, &k);       long long int ans = 0;       ans += (n / k) * k;       if (n - ans > k / 2)         ans += k / 2;       else         ans = n;       printf( %lld n , ans);     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 105;   int freq[N];   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n, m;     cin >> n >> m;     for (int i = 0; i < m; i++) {       int type;       cin >> type;       freq[type]++;     }     int start = 1, end = 100;     while (start <= end) {       int mid = (start + end) >> 1;       int persons = 0;       for (int types = 1; types <= 100; types++) {         persons += (freq[types] / mid);       }       if (persons >= n)         start = mid + 1;       else         end = mid - 1;     }     cout << end <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long TC = 1;     while (TC--) {       long long n;       cin >> n;       vector<long long> a(n);       for (long long i = 0; i < n; i++) cin >> a[i];       long long lcnt = 1, rcnt = 1;       for (long long i = 1; i < n; i++) {         if (a[i] > a[i - 1])           lcnt++;         else           break;       }       for (long long i = n - 1 - 1; i >= 0; i--) {         if (a[i] > a[i + 1])           rcnt++;         else           break;       }       if ((a[0] >= a[n - 1] && lcnt % 2) || (a[0] <= a[n - 1] && rcnt % 2)) {         cout <<  Alice n ;         continue;       } else if (lcnt % 2 == 0 && rcnt % 2 == 0) {         cout <<  Bob n ;       } else {         cout <<  Alice n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 100005;   const double eps = 1.0e-8;   const double pi = acos(-1.0);   complex<double> p[MAXN], P;   double cross(complex<double> a, complex<double> b) {     return (conj(a) * b).imag();   }   double check(complex<double> a, complex<double> b) {     double l = 0, r = 1;     complex<double> v = b - a;     for (int i = 0; i < 50; i++) {       double mid = (l + r) * 0.5;       double midd = (mid + r) * 0.5;       complex<double> x = a + v * mid, y = a + v * midd;       if (abs(P - x) + eps < abs(P - y)) {         r = midd;       } else {         l = mid;       }     }     return abs(P - (a + v * l));   }   int main() {     int n;     cin >> n;     int x, y;     cin >> x >> y;     P = complex<double>(x, y);     for (int i = 0; i < n; i++) {       scanf( %d %d , &x, &y);       p[i] = complex<double>(x, y);     }     p[n] = p[0];     double r1 = 1.0e20, r2 = 0;     for (int i = 0; i < n; i++) {       r1 = min(r1, check(p[i], p[i + 1]));       r2 = max(r2, abs(P - p[i]));     }     printf( %.10f n , pi * (r2 * r2 - r1 * r1));     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 100000;   int f[MAXN + 5];   int main() {     memset(f, 0, sizeof(f));     int m = 0, a = 0, r0 = 0, b = 0, ans = 1;     cin >> a >> b >> m >> r0;     f[r0] = 1;     for (int i = 2;; ++i) {       r0 = (a * r0 + b) % m;       ++ans;       if (f[r0] != 0) {         ans = ans - f[r0];         break;       }       f[r0] = ans;     }     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n, m, count = 0;     cin >> n >> m;     int x = min(n, m);     n = n - x;     m = m - x;     int rest = (n / 2) + (m / 2);     cout << x <<     << rest << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int t;     cin >> t;     while (t--) {       unordered_map<char, int> mp;       int n;       cin >> n;       string arr[n];       for (int i = 0; i < n; i++) {         cin >> arr[i];         for (auto c : arr[i]) {           mp[c]++;         }       }       bool ok = true;       for (auto p : mp) {         if (p.second % n != 0) {           ok = false;           break;         }       }       cout << ((ok) ?  YES n  :  NO n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int a, b, c, l;     cin >> a >> b >> c >> l;     long long int Total = (l + 1) * (l + 2) * (l + 3) / 6;     for (long long int la = 0; la <= l; la++) {       long long int mini = min(a - b - c + la, l - la);       if (mini < 0) continue;       long long int wrong = (mini + 1) * (mini + 2) / 2;       Total -= wrong;     }     for (long long int lb = 0; lb <= l; lb++) {       long long int mini = min(b - a - c + lb, l - lb);       if (mini < 0) continue;       long long int wrong = (mini + 1) * (mini + 2) / 2;       Total -= wrong;     }     for (long long int lc = 0; lc <= l; lc++) {       long long int mini = min(c - b - a + lc, l - lc);       if (mini < 0) continue;       long long int wrong = (mini + 1) * (mini + 2) / 2;       Total -= wrong;     }     cout << Total << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;      const int MAX = 1 << 20;   bitset<MAX> dpgl, mv, dp[20];   map<char, int> to;   char rv[20];   int cnt[20], le[20], ri[20], n, A, B, b;      void solve(int ms) {       int L = 1e9, R = -1, tot = 0;       vector<int> tr, chr, oth;       for(int i = 0; i < b; i++) {           if(ms & (1 << i)) {               L = min(L, le[i]);               R = max(R, ri[i]);               tot += cnt[i];               chr.push_back(i);               if(dp[i][ms ^ (1 << i)])                   dp[i][ms] = dpgl[ms] = 1;           }           else               oth.push_back(i);       }          if(tot >= ((R - L + 1) * A + B - 1) / B)           mv[ms] = 1;          if(oth.empty())           return;          sort(chr.begin(), chr.end(), [&](int a, int b){ return le[a] < le[b]; });       int cms = 0;       for(auto c : chr) {           cms |= (1 << c);           if(mv[cms] && dpgl[cms] && dp[oth[0]][ms ^ cms]) {               for(auto tc : oth)                   dp[tc][ms] = 1;               return;           }       }   }      int main() {       ios_base::sync_with_stdio(false);       cin.tie(0);          cin >> n >> A >> B;       string s;       cin >> s;          for(auto &c : s) {           if(!to.count(c)) {               rv[b] = c;               to[c] = b++;           }       }          for(int i = 0; i < s.size(); i++) {           cnt[to[s[i]]]++;           ri[to[s[i]]] = i;       }       for(int i = s.size() - 1; i >= 0; i--)           le[to[s[i]]] = i;          dpgl[0] = mv[0] = 1;       for(int i = 0; i < b; i++) {           dp[i][0] = dp[i][1 << i] = 1;           dpgl[1 << i] = 1;       }          for(int i = 1; i < (1 << b); i++)           solve(i);          vector<char> ans;          for(int i = 0; i < b; i++)           if(dp[i][(1 << b) - 1])               ans.push_back(rv[i]);          sort(ans.begin(), ans.end());          cout << ans.size();       for(auto &c : ans)           cout <<     << c;       cout <<   n ;          /*for(int i = 0; i < (1 << b); i++) {           for(int j = 0; j < b; j++)               cout << bitset<4>(i) <<     << j <<     << dp[j][i] <<   n ;       }          cout <<   n ;*/   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1e9+7, M = (1e9+7), MAXN = 1 * 2e5;   int A[MAXN], C[MAXN];            int64_t modpow(int64_t a, int64_t b) {       int64_t res = 1;       for(; b; b >>= 1) {           if(b&1)               res=res*a%M;           a=a*a%M;       }       return res;   }   void solve() {       const int MOD = M;       int N, M;       cin >> N >> M;       vector<string> G(N);       for(int i = 0; i < N; i++)           cin >> G[i];          int cnt = 0;       for(int i = 0; i < N; i++)           cnt += count(G[i].begin(), G[i].end(),  # );       cerr <<  Count:   << cnt << endl;       int64_t x = modpow(2, cnt);       if(cnt == N * M) {           cout << (x - 1 + MOD) % MOD << endl;       } else {           cout << modpow(2, cnt) << endl;       }   }   int main() {       cin.tie(0)->sync_with_stdio(0);       int T; cin >> T;          while(T--) {           solve();       }   }
#include <iostream>   #include <fstream>   #include <vector>   #include <algorithm>   #include <cmath>   #include <iomanip>   #include <cstring>      std::ifstream fin( input.txt );   std::ofstream fout( output.txt );      int main(){       std::ios_base::sync_with_stdio(false);       std::cin.tie(NULL);       std::cout.tie(NULL);       std::cout << std::setprecision(6) << std::fixed <<   n ;       int Q;       std::cin >> Q;       while(Q --){           int n, m;           std::cin >> n >> m;           int x[n], pos;           long double ans = 0;           for(int i=0; i<n; i++) std::cin >> x[i];              for(pos=n-1; pos>=0 and x[pos] == pos+1; pos--);              if(pos == -1) ans = 1;              while(m --){               int p;               long double prob;               std::cin >> p >> prob; p--;               if(p >= pos){                   ans = 1.0 - (1.0 - ans) * (1.0 - prob);               }           }           std::cout << ans <<   n ;       }          return 0;      }
#include <bits/stdc++.h>   using namespace std;   const int N = 100010;   long long int A[N];   vector<int> g[N];   long long int dfs(int x, int p) {     A[x] = 1;     for (int i = 0; i < g[x].size(); ++i) {       int y = g[x][i];       if (y == p) continue;       A[x] += dfs(y, x);     }     return A[x];   }   long double E[N];   void solve(int x, int p) {     long long int n = (long long int)g[x].size();     for (int i = 0; i < g[x].size(); ++i) {       int y = g[x][i];       if (y == p) continue;       E[y] = E[x] + 1;       long double med = (A[x] - 1 - A[y]) / (long double)(n - 1);       if (g[x].size() != 1) {         E[y] += (med * (n - 1)) / (2.0);       }       solve(y, x);     }   }   int main(void) {     ios::sync_with_stdio(false);     int n;     cin >> n;     for (int i = 2; i <= n; ++i) {       int x;       cin >> x;       g[x].push_back(i);       g[i].push_back(x);     }     E[1] = 1.0;     dfs(1, -1);     solve(1, -1);     cout.precision(10);     for (int i = 1; i <= n; ++i) {       cout << fixed << E[i] <<    ;     }     cout << endl;   }
#include <bits/stdc++.h>   using namespace std;   const int MAX = 1200;   int x, y;   bool run() {     bool fox = true;     while (1) {       if (fox) {         if (x == 0) {           if (y >= 22) {             y -= 22;           } else {             return false;           }         } else if (x == 1) {           if (y >= 12) {             y -= 12;           } else {             return false;           }         } else {           if (y >= 2) {             x -= 2;             y -= 2;           } else {             return false;           }         }       } else {         if (y >= 22) {           y -= 22;         } else if (y >= 12) {           y -= 12;           if (x == 0) {             return true;           } else {             x--;           }         } else if (y >= 2) {           y -= 2;           if (x < 2) {             return true;           } else {             x -= 2;           }         } else {           return true;         }       }       fox ^= 1;     }     return false;   }   int main() {     scanf( %d%d , &x, &y);     if (run()) {       puts( Ciel );     } else {       puts( Hanako );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 1e3 + 5;   const int maxm = 1 << 13;   int n;   long long k;   pair<int, long long> dp[maxn][maxm];   int pre[maxn][maxm];   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   vector<long long> v;   void get_div(long long k) {     for (long long i = 1; i * i <= k; i++) {       if (k % i == 0) {         long long j = k / i;         v.push_back(i);         if (i != j) v.push_back(j);       }     }     sort(v.begin(), v.end());   }   long long a[maxn], c[maxn];   int main() {     scanf( %d%lld , &n, &k);     get_div(k);     for (int i = 1; i <= n; i++) {       scanf( %lld , &a[i]);       c[i] = gcd(a[i], k);     }     if (k == 1) {       printf( 1 n );       int p = 1;       long long minn = a[1];       for (int i = 2; i <= n; i++) {         if (a[i] < minn) minn = a[i], p = i;       }       printf( %d n , p);       return 0;     }     int m = v.size();     for (int i = 0; i <= n; i++)       for (int j = 0; j < m; j++) dp[i][j] = make_pair((int)1e9, (long long)1e16);     dp[0][0] = make_pair(0, 0);     for (int i = 1; i <= n; i++)       for (int j = 0; j < m; j++) {         if (dp[i][j] > dp[i - 1][j]) {           dp[i][j] = dp[i - 1][j];           pre[i][j] = j;         }         int t =             lower_bound(v.begin(), v.end(), v[j] / gcd(v[j], c[i])) - v.begin();         if (dp[i][j] >             make_pair(dp[i - 1][t].first + 1, dp[i - 1][t].second + a[i])) {           dp[i][j] =               make_pair(dp[i - 1][t].first + 1, dp[i - 1][t].second + a[i]);           pre[i][j] = t;         }       }     if (dp[n][m - 1].first > n)       printf( -1 n );     else {       printf( %d n , dp[n][m - 1].first);       int k = m - 1;       bool first = true;       for (int i = n; i >= 1; i--) {         if (pre[i][k] != k) {           if (first) {             printf( %d , i);             first = false;           } else             printf(  %d , i);         }         k = pre[i][k];       }     }     printf(  n );     return 0;   }
#include <bits/stdc++.h>   int dp[1000];   int mm[200][200];   int main() {     int i, j, n, m, t;     dp[3] = 3;     for (i = 4; i < 1000; ++i) dp[i] = dp[i - 1] + i - 1;     while (scanf( %d , &n) != EOF) {       for (i = 3; i < 1000; ++i) {         if (dp[i] > n) break;       }       m = i - 1;       printf( %d n , m);       t = 1;       for (i = 1; i < m; ++i) {         for (j = i; j < m; ++j) mm[i][j] = mm[j + 1][i] = t++;       }       for (i = 1; i <= m; ++i) {         for (j = 1; j < m; ++j) printf( %d  , mm[i][j]);         printf(  n );       }     }     return 0;   }
#include<bits/stdc++.h>   #include<string.h>   #define int long long   #include<vector>   #define rep(i,a,b)        for(int i=a;i<b;i++)   #define pb                push_back   #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);   using namespace std;   const int N=2e5+5;       vector<int> v[N];   int siz[N];   int lvl[N];       int forefather[N];       int tim = 0, st[N], et[N];       void dfs(int z,int p = -1,int ff = 0){    if(p == -1) lvl[z] = 0;    else lvl[z] = lvl[p] + 1;        if(lvl[z] == 1) ff = z;    forefather[z] = ff;        st[z] = tim++;        siz[z] = 1;    for(int x:v[z]){     if(x == p) continue;     dfs(x,z,ff);     siz[z] += siz[x];    }    et[z] = tim;   }       // x is ancestor of y   bool ancestor(int x,int y){    if(st[y] > st[x] && et[y] <= et[x]){     return true;    }    return false;   }       int calc(int x,int y){    if(y == 0) swap(x,y);    if(x == 0){     return siz[y] * (siz[0] - siz[forefather[y]]);    }    return siz[x] * siz[y];   }       void solve(){    tim = 0;    int n;    cin >> n;    rep(i,0,n){     v[i].clear();     siz[i] = 0;     lvl[i] = 0;     forefather[i] = 0;    }    rep(i,1,n){     int x,y;     cin >> x >> y;     v[x].pb(y);     v[y].pb(x);    }        dfs(0);        int paths = n * (n - 1) / 2;    int donthavezero = 0;    rep(i,1,n){     if(lvl[i] != 1) continue;     donthavezero += siz[i] * (siz[i] - 1) / 2;    }    cout << donthavezero <<    ;    paths -= donthavezero;        int a = 0, b = 0;        rep(i,1,n){     if(paths == 0){      cout << 0 <<    ;      continue;     }     if(a == 0) swap(a,b);     if(ancestor(i,a) || ancestor(i,b)){      cout << 0 <<    ;      continue;     }     if(ancestor(a,i)){      a = i;      int wont_work = calc(a,b);      cout << paths - wont_work <<    ;      paths = wont_work;     }     else if(ancestor(b,i)){      if(forefather[i] == forefather[a]){       cout << paths <<    ;       paths = 0;       continue;      }      b = i;      int wont_work = calc(a,b);      cout << paths - wont_work <<    ;      paths = wont_work;     }     else{      cout << paths <<    ;      paths = 0;     }    }        cout << paths;        cout <<   n ;   }   signed main(){    ios_base::sync_with_stdio(false);    cin.tie(0);cout.tie(0);        int t=1;    cin>>t;    while(t--) solve();    return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long ans = -((long long)1 << 62);   int n, u, r;   int a[105];   int b[105];   int k[105];   int p[105];   void process(int m, int op) {     if (((u - m) & 1) == 0) {       long long an = 0;       for (int i = 1; i <= n; i++) an += a[i] * k[i];       ans = max(an, ans);     }     if (m == u) {       return;     }     if (op == 0) {       for (int i = 1; i <= n; i++) a[i] ^= b[i];       process(m + 1, 1);       for (int i = 1; i <= n; i++) a[i] ^= b[i];     }     vector<int> a1;     a1.push_back(1);     for (int i = 1; i <= n; i++) a1.push_back(a[i]);     for (int i = 1; i <= n; i++) a[i] = a1[p[i]] + r;     process(m + 1, 0);     for (int i = 1; i <= n; i++) a[i] = a1[i];   }   int main() {     scanf( %d %d %d , &n, &u, &r);     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     for (int i = 1; i <= n; i++) scanf( %d , &b[i]);     for (int i = 1; i <= n; i++) scanf( %d , &k[i]);     for (int i = 1; i <= n; i++) scanf( %d , &p[i]);     process(0, 0);     printf( %I64d , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     int m;     int k;     vector<vector<int> > A;     cin >> n >> m >> k;     for (int i = 0; i < n; i++) {       vector<int> X;       for (int j = 0; j < m; j++) {         int l;         cin >> l;         X.push_back(l);       }       A.push_back(X);     }     int totalSum = 0;     int changes = 0;     for (int j = 0; j < m; j++) {       int maxSum = 0;       vector<int> maxI;       maxI.push_back(0);       for (int i = 0; i < n; i++) {         if (A[i][j] == 1) {           int sum = 0;           for (int z = i; z < min(i + k, n); z++) {             sum += A[z][j];           }           if (sum > maxSum) {             maxSum = sum;             for (int elem = 0; elem < maxI.size(); elem++) {               maxI[elem] = i;             }           } else if (sum == maxSum) {             maxI.push_back(i);           }         }       }       int minimumChanges = 10000000;       for (auto elem : maxI) {         int toChange = 0;         for (int i = 0; i < elem; i++) {           if (A[i][j] == 1) {             toChange++;           }         }         if (toChange < minimumChanges) {           minimumChanges = toChange;         }       }       changes += minimumChanges;       totalSum += maxSum;     }     cout << totalSum <<     << changes;     return 0;   }