malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   #pragma GCC optimize( O3 )   using namespace std;   struct edge {     int from;     int to;     int w;   };   int comp(const edge& f, const edge& l) {     if (f.from < l.from)       return 1;     else if (f.from > l.from)       return 0;     else {       if (f.w > l.w) return 1;     }     return 0;   }   map<int, vector<edge> > d;   int check_cnt(int sum) {     sort(d[sum].begin(), d[sum].end(), comp);     set<pair<int, int> > wait;     int cnt = 0;     for (edge it : d[sum]) {       if (it.w == 1)         wait.insert({it.from, it.to});       else {         if (wait.count({it.to, it.from})) {           cnt++;           wait.clear();         }       }     }     return cnt;   }   void make(int sum) {     sort(d[sum].begin(), d[sum].end(), comp);     set<pair<int, int> > wait;     for (edge& it : d[sum]) {       if (it.w == 1)         wait.insert({it.from, it.to});       else {         if (wait.count({it.to, it.from})) {           cout << it.to + 1 <<     << it.from + 1 <<   n ;           wait.clear();         }       }     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0), cout.tie(0);     int n;     cin >> n;     vector<int> a(n);     vector<int> p(n + 1, 0);     for (int i = 0; i < n; i++) {       cin >> a[i];       p[i + 1] = p[i] + a[i];     }     int sum = 0;     for (int i = 0; i < n; i++) {       for (int j = i; j < n; j++) {         sum = p[j + 1] - p[i];         d[sum].push_back((edge){i, j, 1});         d[sum].push_back((edge){j, i, -1});       }     }     int max_val = 0, max_cnt = 0, cnt = 0;     for (auto& it : d) {       cnt = check_cnt(it.first);       if (max_cnt < cnt) {         max_cnt = cnt;         max_val = it.first;       }     }     cout << max_cnt <<   n ;     make(max_val);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   long long fastexp(long long b, long long exp) {     if (exp == 0) return 1;     long long temp = fastexp(b, exp / 2);     temp = (temp * temp) % 998244353;     if (exp % 2 == 1) temp *= b;     return temp % 998244353;   }   long long fact[100001], inv[100001];   void precompute() {     fact[0] = 1;     inv[0] = 1;     for (int i = 1; i <= 100000; i++) {       fact[i] = (fact[i - 1] * i) % 998244353;       inv[i] = fastexp(fact[i], 998244353 - 2);     }   }   long long choose(int n, int k) {     if (n < 0 || k < 0 || k > n) return 0;     long long ans = (fact[n] * inv[k]) % 998244353;     ans = (ans * inv[n - k]) % 998244353;     return ans;   }   bool row[3605], col[3605];   int H, W, N;   long long dp1[3605][3605], dp2[3605][3605];   int emptyH, emptyW;   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     precompute();     cin >> H >> W >> N;     for (int i = 0; i < N; i++) {       int r1, c1, r2, c2;       cin >> r1 >> c1 >> r2 >> c2;       row[r1] = true;       row[r2] = true;       col[c1] = true;       col[c2] = true;     }     for (int i = 1; i <= H; i++)       if (!row[i]) emptyH++;     for (int i = 1; i <= W; i++)       if (!col[i]) emptyW++;     dp1[0][0] = true;     for (int i = 1; i <= H; i++) {       for (int j = 0; j <= i; j++) {         if (row[i] || row[i - 1])           dp1[i][j] = dp1[i - 1][j];         else {           dp1[i][j] = dp1[i - 1][j];           if (i - 2 >= 0 && j - 1 >= 0) dp1[i][j] += dp1[i - 2][j - 1];           dp1[i][j] %= 998244353;         }       }     }     dp2[0][0] = true;     for (int i = 1; i <= W; i++) {       for (int j = 0; j <= i; j++) {         if (col[i] || col[i - 1])           dp2[i][j] = dp2[i - 1][j];         else {           dp2[i][j] = dp2[i - 1][j];           if (i - 2 >= 0 && j - 1 >= 0) dp2[i][j] += dp2[i - 2][j - 1];           dp2[i][j] %= 998244353;         }       }     }     long long ans = 0;     for (int i = 0; i <= H; i++) {       for (int j = 0; j <= W; j++) {         long long R = dp1[H][j] * choose(emptyH - 2 * j, i);         R %= 998244353;         long long C = dp2[W][i] * choose(emptyW - 2 * i, j);         C %= 998244353;         long long F = (fact[i] * fact[j]) % 998244353;         ans += ((R * C) % 998244353 * F) % 998244353;         ans %= 998244353;       }     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int a[100000], b[100000], c[100000][2];   int n, m;   long long k, sum;   int main() {     cin >> n >> k;     sum = 0;     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       b[i] = a[i];       long long aa = a[i];       sum += aa;     }     if (sum <= k) {       if (sum < k) {         printf( -1 n );       }       return 0;     }     sort(b, b + n);     m = 0;     c[0][0] = b[0];     c[0][1] = 0;     for (int i = 1; i < n; i++)       if (b[i] != b[i - 1]) {         m++;         c[m][0] = b[i];         c[m][1] = i;       }     int pre = 0;     for (int i = 0; i <= m; i++) {       long long u, v, duc;       v = c[i][0] - pre;       u = n - c[i][1];       duc = u * v;       if (duc <= k) {         k -= duc;       } else {         int h = -1;         for (int j = 0; j < n; j++)           if (a[j] >= c[i][0]) {             h++;             a[h] = a[j];             b[h] = j;           }         long long s, t;         s = k / u;         t = k % u;         int tt, ss;         tt = t;         ss = s;         for (int j = tt; j <= h; j++) {           if (j != tt) {             printf(   );           }           printf( %d , b[j] + 1);         }         for (int j = 0; j < tt; j++)           if ((ss + 1 != v) || (a[j] != c[i][0])) {             printf(  %d , b[j] + 1);           }         printf(  n );         break;       }       pre = c[i][0];     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string a, b;     int n;     cin >> n >> a >> b;     int ans = 0;     for (int i = 0; i < n - 1; i++) {       if (a[i] != b[i]) {         if (a[i] ==  1 ) {           if (a[i + 1] ==  0  && a[i + 1] != b[i + 1]) {             a[i] =  0 ;             a[i + 1] =  1 ;             ans++;           } else {             a[i] =  0 ;             ans++;           }         } else {           if (a[i + 1] ==  1  && a[i + 1] != b[i + 1]) {             a[i] =  1 ;             a[i + 1] =  0 ;             ans++;           } else {             a[i] =  1 ;             ans++;           }         }       }     }     if (a[n - 1] != b[n - 1]) ans++;     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   vector<int> t, a, b;   vector<pair<int, int>> p;   void push(int v) {     if (t[v] != -1) {       t[v * 2] = t[v * 2 + 1] = t[v];       t[v] = -1;     }   }   void update(int v, int l, int r, int vl, int vr, int color) {     if (vl > vr) return;     if (l == vl && r == vr)       t[v] = color;     else {       push(v);       int m = (l + r) / 2;       update(v * 2, l, m, vl, min(vr, m), color);       update(v * 2 + 1, m + 1, r, max(vl, m + 1), vr, color);     }   }   int get(int v, int l, int r, int pos) {     if (l == r) return t[v];     push(v);     int m = (l + r) / 2;     if (m >= pos)       return get(v * 2, l, m, pos);     else       return get(v * 2 + 1, m + 1, r, pos);   }   int main() {     cin >> n >> m;     a.resize(n);     b.resize(n);     for (int i = 0; i < n; ++i) cin >> a[i];     for (int i = 0; i < n; ++i) cin >> b[i];     int bin = 1;     while (bin < n) bin *= 2;     n = bin;     t.assign(n * 2, -1);     for (int i = 0; i < m; ++i) {       int type;       cin >> type;       if (type == 1) {         int l, q, k;         cin >> l >> q >> k;         update(1, 0, n - 1, q - 1, q + k - 2, p.size());         p.push_back({l, q});       } else {         int x, y = -1;         cin >> x;         y = get(1, 0, n - 1, x - 1);         if (y == -1)           cout << b[x - 1] <<   n ;         else           cout << a[p[y].first + x - p[y].second - 1] <<   n ;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int f[11][11][4][100010];   int n;   char s[100010];   char c[100010];   int ch(char s) {     if (s ==  A )       return 0;     else if (s ==  C )       return 1;     else if (s ==  T )       return 2;     else if (s ==  G )       return 3;     return -1;   }   void Add(int *tr, int x, int d) {     for (; x <= n; x += x & (-x)) {       tr[x] += d;     }   }   int Sum(int *tr, int x) {     if (x == 0) return 0;     int s = 0;     while (x) {       s += tr[x];       x -= x & (-x);     }     return s;   }   int main() {     scanf( %s , s);     n = strlen(s);     for (int i = n - 1; i >= 0; i--) s[i + 1] = s[i];     s[0] = 0;     for (int i = 1; i <= n; i++)       for (int j = 1; j <= 10; j++) Add(f[j][i % j][ch(s[i])], i, 1);     int q, x, d, l, r;     scanf( %d , &q);     while (q--) {       scanf( %d , &x);       if (x == 1) {         scanf( %d%s , &d, c);         for (int i = 1; i <= 10; i++) Add(f[i][d % i][ch(s[d])], d, -1);         s[d] = c[0];         for (int i = 1; i <= 10; i++) Add(f[i][d % i][ch(s[d])], d, 1);       } else {         scanf( %d%d%s , &l, &r, c);         int len = strlen(c);         int ans = 0;         for (int i = 0; i < len; i++)           ans += Sum(f[len][(l + i) % len][ch(c[i])], r) -                  Sum(f[len][(l + i) % len][ch(c[i])], l - 1);         printf( %d n , ans);       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, ds[3001], sz[3001], ot[3001], a, b, c, no, ans, sum;   vector<pair<int, pair<int, int> > > v;   int get(int x) {     if (ds[x] == x)       return x;     else       return ds[x] = get(ds[x]);   }   void merge(int x, int y) {     sz[x] += sz[y];     ds[y] = x;     ot[x] += ot[y];     if (sz[x] > sum - ot[x]) no = 1;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n;     for (int i = 0; i < n - 1; ++i) {       cin >> a >> b >> c;       v.push_back(make_pair(c, make_pair(a, b)));     }     sort(v.begin(), v.end());     for (int i = 1; i <= n; ++i) {       cin >> ot[i];       sz[i] = 1;       ds[i] = i;       sum += ot[i];     }     for (int i = 1; i <= n; ++i)       if (sz[i] > sum - ot[i]) no = 1;     if (!no && n > 1) ans = v[0].first;     for (int i = 0; i < v.size();) {       int j = i;       while (j < v.size() && v[i].first == v[j].first) {         merge(get(v[j].second.first), get(v[j].second.second));         ++j;       }       i = j;       if (!no && i < v.size()) ans = v[i].first;     }     cout << ans <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1}, n, m;   const int N = 1505;   char c[N][N];   pair<int, int> seen[N][N];   int mod(int a, int m) {     while (a < 0) a += m;     return a % m;   }   bool dfs2(int x, int y) {     if (c[mod(x, n)][mod(y, m)] ==  # ) return false;     if (seen[mod(x, n)][mod(y, m)] != make_pair(1 << 27, 1 << 27)) {       if (seen[mod(x, n)][mod(y, m)] != make_pair(x, y))         return true;       else         return false;     }     seen[mod(x, n)][mod(y, m)] = make_pair(x, y);     for (int k = 0; k < 4; k++)       if (dfs2(x + dx[k], y + dy[k])) return true;     return false;   }   int k, comp[N][N], start_comp, start_x, start_y;   bool seen_edge;   vector<pair<int, int> > edges;   vector<int> edge_style;   void dfs(int x, int y) {     if (x < 0 || x >= n || y < 0 || y >= m) {       seen_edge = true;       return;     }     if (comp[x][y] || c[x][y] ==  # ) return;     if (c[x][y] ==  S ) {       start_x = x;       start_y = y;       start_comp = k;     }     comp[x][y] = k;     for (int k = 0; k < 4; k++) dfs(x + dx[k], y + dy[k]);   }   int dist[10000];   const int inf = 1 << 27;   bool relax(int a, int b, int w) {     if (dist[b] < inf && dist[a] > dist[b] + w) {       dist[a] = dist[b] + w;       return true;     }     return false;   }   int main() {     cin >> n >> m;     for (int i = 0; i < n; i++) cin >> c[i];     k = 1;     start_comp = -1;     memset(comp, 0, sizeof(comp));     start_x = -1;     start_y = -1;     for (int i = 0; i < n; i++)       for (int j = 0; j < m; j++)         if (!comp[i][j] && c[i][j] !=  # ) {           seen_edge = false;           dfs(i, j);           if (seen_edge)             k++;           else if (start_x >= 0 && start_y >= 0 && comp[start_x][start_y] == k) {             cout <<  No  << endl;             return 0;           }         }     edges.clear();     edge_style.clear();     for (int i = 0; i < n; i++) {       if (c[i][0] !=  #  && c[i][m - 1] !=  # ) {         edge_style.push_back(1);         edges.push_back(make_pair(comp[i][m - 1], comp[i][0]));       }     }     for (int j = 0; j < m; j++) {       if (c[0][j] !=  #  && c[n - 1][j] !=  # ) {         edge_style.push_back(2);         edges.push_back(make_pair(comp[n - 1][j], comp[0][j]));       }     }     bool flag = false;     for (int z = 0; z < 4; z++) {       for (int i = 1; i < k; i++) dist[i] = inf;       dist[start_comp] = 0;       for (int i = 0; i < k; i++)         for (int j = 0; j < edges.size(); j++) {           int a = edges[j].first, b = edges[j].second;           int dw = (edge_style[j] == 1) ? (z % 2 ? 1 : -1) : (z / 2 ? 1 : -1);           bool u = relax(a, b, dw), v = relax(b, a, -dw);           if (i == k - 1 && (u || v)) flag = true;         }     }     cout << (flag ?  Yes  :  No ) << endl;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     long a[1000];     cin >> n;     cin >> a[0];     long max = a[0], min = a[0];     for (int i = 1; i < n; i++) {       cin >> a[i];       if (a[i] > max) {         max = a[i];       } else if (a[i] < min) {         min = a[i];       }     }     cout << max - min - (n - 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int N;   vector<int> graph[100010];   int deg[100010];   int sum[100010];   long long dpa[100010], dpb[100010];   long long power(long long x, long long n) {     if (n == 0) return 1;     long long y = power(x, n / 2);     y = y * y % 1000000007ll;     if (n % 2 == 1) y = y * x % 1000000007ll;     return y;   }   void dfs(int p, int x) {     int i;     if (deg[x] == 1) {       dpa[x] = dpb[x] = 0;       return;     }     long long A = 0, B = 0;     int K = 0;     for ((i) = 0; (i) < (int)(graph[x].size()); (i)++) {       int y = graph[x][i];       if (y == p) continue;       K++;       dfs(x, y);       A = (A + dpa[y]) % 1000000007ll;       B = (B + dpb[y]) % 1000000007ll;     }     int K2 = K + 1;     if (x == 0) K2--;     dpa[x] = power((K2 - A + 1000000007ll) % 1000000007ll, 1000000007ll - 2);     dpb[x] = (B + sum[x]) * dpa[x] % 1000000007ll;   }   int main(void) {     int i;     cin >> N;     for ((i) = 0; (i) < (int)(N - 1); (i)++) {       int a, b, c;       scanf( %d%d%d , &a, &b, &c);       graph[a].push_back(b);       graph[b].push_back(a);       deg[a]++;       deg[b]++;       sum[a] += c;       sum[b] += c;     }     dfs(-1, 0);     cout << dpb[0] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T sqr(T x) {     return x * x;   }   const int maxn = 1000;   int n, m, val;   char s[maxn][maxn];   int f[maxn][maxn];   int sum[maxn][maxn];   long long res;   int main() {     for (int i = 0; i < int(maxn); i++)       for (int j = 0; j < int(maxn); j++) {         s[i][j] = 0;         f[i][j] = 0;         sum[i][j] = 0;       }     cin >> n >> m >> val;     for (int i = int(1); i < int(n + 1); i++)       for (int j = int(1); j < int(m + 1); j++) cin >> s[i][j];     for (int i = int(1); i < int(n + 1); i++)       for (int j = int(1); j < int(m + 1); j++) {         if (s[i][j] ==  1  && s[i - 1][j] ==  1  && s[i + 1][j] ==  1  &&             s[i][j - 1] ==  1  && s[i][j + 1] ==  1 )           f[i + 1][j + 1] = 1;       }     for (int i = int(1); i < int(n + 1); i++)       for (int j = int(1); j < int(m + 1); j++) {         sum[i][j] = (sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1]) + f[i][j];       }     for (int i = int(1); i < int(n); i++)       for (int j = int(1); j < int(m); j++) {         for (int k = int(1); k < int(m - j + 2); k++) {           int l = i + 1, r = n + 1, cur;           while (l < r - 1) {             cur = (l + r) >> 1;             if (sum[cur][j + k - 1] - sum[cur][j + 1] - sum[i + 1][j + k - 1] +                     sum[i + 1][j + 1] <                 val)               l = cur;             else               r = cur;           }           res += n - l;         }       }     cout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   long long expo(long long n) {     if (n == 0) return 1;     if (n % 2) {       long long x = expo(n / 2);       return x * x * 2;     } else {       long long x = expo(n / 2);       return x * x;     }   }   int main() {     ios_base::sync_with_stdio(false);     long long x, y, z, i, j, k, f = 0, n, m;     cin >> n >> m;     x = m;     while (x > 0) {       f++;       x /= 2;     }     if (f < n) {       cout << m;     } else {       cout << m % expo(n);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int inf = 2e9;   const long long INF = 8e18;   const int maxn = 1e5 + 5;   int n;   int cnt[maxn], val[maxn];   long long S, SUM;   vector<pair<int, int> > e[maxn];   inline void dfs(int u, int pre) {     if (u != 1 && e[u].size() == 1) {       cnt[u] = 1;     }     for (auto &x : e[u]) {       int v = x.first, w = x.second;       if (v == pre) {         continue;       }       val[v] = w;       dfs(v, u);       cnt[u] += cnt[v];     }   }   inline void init() {     for (int i = 0; i < n + 5; ++i) {       e[i].clear();       cnt[i] = 0;     }     SUM = 0;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int T;     cin >> T;     while (T--) {       cin >> n >> S;       for (int i = 1; i <= n - 1; ++i) {         int u, v, w;         cin >> u >> v >> w;         e[u].push_back({v, w});         e[v].push_back({u, w});       }       dfs(1, 1);       priority_queue<pair<long long, int> > pq;       for (int i = 2; i <= n; ++i) {         SUM += 1ll * val[i] * cnt[i];         pq.push({1ll * (val[i] - (val[i] >> 1)) * cnt[i], i});         val[i] >>= 1;       }       int ans = 0;       while (SUM > S) {         ++ans;         auto now = pq.top();         pq.pop();         long long w = now.first, id = now.second;         SUM -= w;         pq.push({1ll * (val[id] - (val[id] >> 1)) * cnt[id], id});         val[id] >>= 1;       }       cout << ans <<   n ;       init();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using ull = unsigned long long;   using ld = long double;   template <typename T1, typename T2>   inline void chkmin(T1 &x, const T2 &y) {     if (x > y) x = y;   }   template <typename T1, typename T2>   inline void chkmax(T1 &x, const T2 &y) {     if (x < y) x = y;   }   int n, m, k;   vector<pair<int, int>> a[4];   set<pair<int, int>> L, R;   int sumSet;   void read() {     cin >> n >> m >> k;     for (int i = 0; i < n; i++) {       int t, f1, f2;       cin >> t >> f1 >> f2;       a[f1 * 2 + f2].push_back({t, i});     }     for (int i = 0; i <= 3; i++) sort(a[i].begin(), a[i].end());   }   void relax(int sz) {     sz = max(sz, 0);     while (L.size() > sz) {       auto x = *(--L.end());       L.erase(--L.end());       sumSet -= x.first;       R.insert(x);     }     while (L.size() < sz) {       if (R.empty()) break;       auto x = *(R.begin());       R.erase(R.begin());       L.insert(x);       sumSet += x.first;     }   }   void add(pair<int, int> a) {     if (R.empty()) {       L.insert(a);       sumSet += a.first;     } else if (L.empty()) {       R.insert(a);     } else if (*(R.begin()) < a) {       R.insert(a);     } else {       L.insert(a);       sumSet += a.first;     }   }   int ans;   vector<int> fans;   void run() {     ans = 2e9 + 228 + 1337;     for (int it = 0; it < 2; it++) {       L.clear();       R.clear();       sumSet = 0;       int sum = 0;       int top1 = (int)a[1].size() - 1;       int top2 = (int)a[2].size() - 1;       for (auto i : a[0]) add(i);       for (auto i : a[1]) sum += i.first;       for (auto i : a[2]) sum += i.first;       for (int i = 0; i <= min(m, (int)a[3].size()); i++) {         if (i > 0) sum += a[3][i - 1].first;         while (top1 >= 0 && top1 + 1 + i > k) {           sum -= a[1][top1].first;           add(a[1][top1--]);         }         while (top2 >= 0 && top2 + 1 + i > k) {           sum -= a[2][top2].first;           add(a[2][top2--]);         }         if (min(top1, top2) + 1 + i < k) continue;         int sz = m - i - (top1 + 1) - (top2 + 1);         if (sz < 0) continue;         if (L.size() + R.size() < sz) continue;         relax(sz);         chkmin(ans, sum + sumSet);         if (!it || sum + sumSet != ans) continue;         for (auto j : L) {           fans.push_back(j.second);         }         for (int j = 0; j <= top1; j++) {           fans.push_back(a[1][j].second);         }         for (int j = 0; j <= top2; j++) {           fans.push_back(a[2][j].second);         }         for (int j = 0; j < i; j++) {           fans.push_back(a[3][j].second);         }         return;       }     }     cout << -1 << endl;     exit(0);   }   void write() {     cout << ans << endl;     sort(fans.begin(), fans.end());     for (auto i : fans) {       cout << i + 1 <<    ;     }     cout << endl;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     read();     run();     write();     return 0;   }
#include <bits/stdc++.h>   int main() {     int n, i;     scanf( %d , &n);     int array[n];     for (i = 0; i < n; i++) {       scanf( %d , &array[i]);     }     int min = 9999999, max = 0, count;     for (i = 0; i < n; i++) {       if (array[i] < min) {         min = array[i];       }       if (array[i] > max) {         max = array[i];       }     }     int maxIndex, minIndex;     for (i = 0; i < n; i++) {       if (array[i] == max) {         maxIndex = i;         break;       }     }     for (i = n - 1; i >= 0; i--) {       if (array[i] == min) {         minIndex = i;         break;       }     }     int maxDistance, minDistance;     int swapCount = 0;     for (i = maxIndex; i > 0; i--) {       swapCount++;       int temp = array[i];       array[i] = array[i - 1];       array[i - 1] = temp;     }     for (i = 0; i < n; i++) {       if (array[i] == max) {         maxIndex = i;         break;       }     }     for (i = n - 1; i >= 0; i--) {       if (array[i] == min) {         minIndex = i;         break;       }     }     for (i = minIndex; i < n - 1; i++) {       swapCount++;       int temp = array[i];       array[i] = array[i + 1];       array[i + 1] = temp;     }     printf( %d , swapCount);   }