malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n;     cout << endl;     cin >> k;     for (int i = 1; i <= k; i++) {       if (n % 10 == 0) {         n = n / 10;       } else if (n % 10 != 0) {         n = n - 1;       }     }     cout << n;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int Z = (int)2e6 + 111;   const int inf = (int)1e9 + 111;   const long long llinf = (long long)1e18 + 5;   const int MOD = (int)1e9 + 7;   vector<pair<int, int> > g[Z];   vector<long long> d[Z], pref[Z];   long long f[Z];   void dfs(int v) {     for (auto to : g[v]) {       dfs(to.first);     }     vector<long long> v1, v2;     int f = 0;     for (auto to : g[v]) {       f++;       for (int i = 0; i < (int)d[to.first].size(); ++i) {         if (f % 2) v1.push_back(d[to.first][i] + to.second);         if (f % 2 == 0) v2.push_back(d[to.first][i] + to.second);       }     }     merge((v1).begin(), (v1).end(), (v2).begin(), (v2).end(),           back_inserter(d[v]));     d[v].resize((int)d[v].size() + 1);     for (int i = (int)d[v].size() - 1; i >= 1; --i) {       d[v][i] = d[v][i - 1];     }     d[v][0] = 0;   }   int main() {     srand(time(0));     int n, m;     scanf( %d%d , &n, &m);     for (int i = 1; i < n; ++i) {       int w;       scanf( %d , &w);       g[(i + 1) / 2].push_back(make_pair(i + 1, w));       f[i + 1] = w;     }     dfs(1);     for (int i = 1; i <= n; ++i) {       pref[i].resize((int)d[i].size());       pref[i][0] = d[i][0];       for (int j = 1; j < (int)d[i].size(); ++j) {         pref[i][j] = pref[i][j - 1] + d[i][j];       }     }     while (m--) {       long long v, h;       scanf( %I64d%I64d , &v, &h);       int pr = -1;       long long ans = 0, len = 0;       while (v) {         int cntL = --upper_bound((d[2 * v]).begin(), (d[2 * v]).end(),                                  h - len - f[2 * v]) -                    d[2 * v].begin();         int cntR = --upper_bound((d[2 * v + 1]).begin(), (d[2 * v + 1]).end(),                                  h - len - f[2 * v + 1]) -                    d[2 * v + 1].begin();         if (pr == -1 && cntL != -1)           ans += 1LL * h * (cntL + 1) - (len + f[2 * v]) * (cntL + 1) -                  pref[2 * v][cntL];         if (pr == -1 && cntR != -1)           ans += 1LL * h * (cntR + 1) - (len + f[2 * v + 1]) * (cntR + 1) -                  pref[2 * v + 1][cntR];         if (pr == 0 && cntL != -1)           ans += 1LL * h * (cntL + 1) - (len + f[2 * v]) * (cntL + 1) -                  pref[2 * v][cntL];         if (pr == 1 && cntR != -1)           ans += 1LL * h * (cntR + 1) - (len + f[2 * v + 1]) * (cntR + 1) -                  pref[2 * v + 1][cntR];         if (len < h) ans += h - len;         len += f[v];         pr = v % 2 ^ 1;         v /= 2;       }       printf( %I64d n , ans);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     string s;     cin >> s;     long long n = s.length();     vector<long long> prefix(n + 1, 0);     for (long long i = 1; i <= n; i++) {       if (isupper(s[i - 1]))         prefix[i] = prefix[i - 1] + 1;       else         prefix[i] = prefix[i - 1];     }     long long ans = LLONG_MAX;     for (long long i = 0; i <= n; i++) {       long long up = i - prefix[i];       long long down = prefix[n] - prefix[i];       ans = min(ans, up + down);     }     cout << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = 1e10 + 7;   const long long mod = 1e9 + 7;   template <class T>   void read(T &val) {     cin >> val;   }   template <class T>   void read(vector<T> &a, long long n, long long g = 0) {     for (long long i = g; i < n + g; i++) cin >> a[i];   }   template <class T>   void pv(vector<T> &a) {     for (auto i : a) cout << i <<    ;     cout <<   n ;   }   void solver() {     long long n, t;     cin >> n >> t;     long long ans = -inf;     for (long long i = 0; i < n; i++) {       long long c, d;       cin >> c >> d;       if (d < t) {         ans = max(ans, c);       } else {         ans = max(ans, c - (d - t));       }     }     cout << ans <<   n ;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cout << fixed << setprecision(15);     long long t = 1;     while (t--) {       solver();     }   }
#include <bits/stdc++.h>   using namespace std;   char b[1000001];   int main() {     int n, i, c = 0, k = 0, f1 = 0;     long int z = 0;     cin >> n;     int a[n];     for (i = 0; i < n; i++) {       cin >> a[i];       if (a[i] == 0) c++;     }     while (c != n) {       if (k == 0) {         for (i = 0; i < n; i++) {           f1 = 0;           if (a[i] != 0) {             b[z] =  P ;             z++;             a[i]--;             if (a[i] == 0) {               c++;               f1 = 1;             }             if (i == n - 1 && c != n) {               b[z] =  L ;               z++;             } else if (c != n) {               b[z] =  R ;               z++;             }           }           if (c == n) break;           if (a[i] == 0 && f1 == 0 && i == n - 1) {             b[z] =  L ;             z++;           } else if (a[i] == 0 && f1 == 0) {             b[z] =  R ;             z++;           }         }         k = 1;       } else {         for (i = n - 2; i > 0; i--) {           f1 = 0;           if (a[i] != 0) {             b[z] =  P ;             z++;             a[i]--;             if (a[i] == 0) {               f1 = 1;               c++;             }             if (c != n) {               b[z] =  L ;               z++;             }           }           if (c == n) break;           if (a[i] == 0 && f1 == 0) {             b[z] =  L ;             z++;           }         }         k = 0;       }     }     cout << b;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double jav, ans, a[10], b[10], h[5];   int main() {     for (int i = 1; i <= 5; i++) cin >> a[i];     for (int i = 1; i <= 5; i++) cin >> b[i];     cin >> h[0] >> h[1];     for (int i = 1; i <= 5; i++)       jav += max((double)(150 * i), (1 - (a[i] / 250)) * 500 * i - b[i] * 50);     jav = jav + 50 * (2 * h[0] - h[1]);     cout << jav;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long tc, n, i, o, l, j;     string s;     cin >> tc;     while (tc--) {       long long one = 0;       vector<long long> v;       cin >> s;       getchar();       s = s +  0 ;       for (i = 0; i < s.size(); i++) {         if (s[i] ==  1 ) {           one++;         } else {           if (one >= 1) {             v.push_back(one);             one = 0;           }         }       }       cout << endl;       if (v.size() == 0) {         cout <<  0  << endl;       } else {         sort(v.begin(), v.end(), greater<long long>());         long long alice = 0;         for (i = 0; i < v.size(); i += 2) {           alice += v[i];         }         cout << alice << endl;       }       v.clear();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int a, b, c;     double x, s, x1, x2;     long long int l;     while (~scanf( %lld%lld%lld , &a, &b, &c)) {       if (a == 0 && b == 0 && c == 0)         printf( -1 n );       else if (a == 0 && b == 0)         printf( 0 n );       else if (b == 0 && c == 0)         printf( 1 n0 n );       else if (a == 0 && c == 0)         printf( 1 n0 n );       else if (a == 0) {         x = -1.0 * c / b;         printf( 1 n%.10lf n , x);       } else if (b == 0) {         s = -1.0 * c / a;         if (s < 0)           printf( 0 n );         else {           x = sqrt(s);           printf( 2 n%.10lf n%.10lf n , -x, x);         }       } else if (c == 0) {         x = -1.0 * b / a;         if (x > 0)           printf( 2 n0 n%.10lf n , x);         else           printf( 2 n%.10lf n0 n , x);       } else {         l = b * b - 4 * a * c;         if (l < 0)           printf( 0 n );         else if (l == 0)           printf( 1 n%.10lf n , -1.0 * b / 2 / a);         else {           x1 = 1.0 * (-b - sqrt(l)) / 2 / a;           x2 = 1.0 * (-b + sqrt(l)) / 2 / a;           if (x2 - x1 > 1e-10)             printf( 2 n%.10lf n%.10lf n , x1, x2);           else             printf( 2 n%.10lf n%.10lf n , x2, x1);         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m;   vector<int> edge[1000006];   vector<int> ans;   int vis[1000006];   int main() {     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       int u, v;       scanf( %d%d , &u, &v);       edge[u].push_back(v);     }     for (int i = 1; i <= n; i++) {       if (!vis[i]) {         for (int j = 0; j < (int)((edge[i]).size()); j++)           if (edge[i][j] > i) vis[edge[i][j]] = 1;       }     }     for (int i = n; i >= 1; i--) {       if (!vis[i]) {         for (int j = 0; j < (int)((edge[i]).size()); j++) vis[edge[i][j]] = 1;       }     }     for (int i = 1; i <= n; i++)       if (!vis[i]) ans.push_back(i);     printf( %d n , (int)((ans).size()));     for (int i = 0; i < (int)((ans).size()); i++)       printf( %d%c , ans[i], i == (int)((ans).size()) - 1 ?   n  :    );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long inf = 2147483647;   const long long ll = 9223372036854775807, ninf = 1000000000;   const double eps = 1e-6;   const long long nll = 1000000000000000000;   int main() {     long long a, b;     while (cin >> a >> b) {       long long nb = 0, nc = 0;       long long ans = 0;       vector<pair<long long, long long> > A, B;       for (int i = 0; i < a; i++) {         long long x, y, z;         cin >> x >> y >> z;         if (y > z) {           ans += x * y;           pair<long long, long long> tmp;           tmp.first = y - z;           tmp.second = x;           nb += x;           A.push_back(tmp);         } else {           ans += x * z;           pair<long long, long long> tmp;           tmp.first = z - y;           tmp.second = x;           nc += x;           B.push_back(tmp);         }       }       nb %= b;       nc %= b;       if (nb + nc > b) {         cout << ans << endl;         continue;       }       long long ta = 0, tb = 0;       sort(A.begin(), A.end());       sort(B.begin(), B.end());       for (int i = 0; nb; i++) {         ta += min(nb, A[i].second) * A[i].first;         nb -= min(nb, A[i].second);       }       for (int i = 0; nc; i++) {         tb += min(nc, B[i].second) * B[i].first;         nc -= min(nc, B[i].second);       }       long long num = min(tb, ta);       ans -= num;       cout << ans << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   inline int read() {     int nm = 0, fh = 1;     char c = getchar();     for (; !isdigit(c); c = getchar())       if (c ==  - ) fh = -1;     for (; isdigit(c); c = getchar()) nm = nm * 10 + c -  0 ;     return nm * fh;   }   int b, n, a[200020], ans;   int main() {     b = read() & 1, n = read();     for (int i = 1; i < n; i++) a[i] = read() & 1, ans += a[i] * b;     a[n] = read() & 1, ans += a[n];     printf((ans & 1) ?  odd  :  even );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int x, k, i;     cin >> x >> k;     if (k == 0) {       cout << x / 2 <<     << x - 1 << endl;       return 0;     }     int *d1 = new int[x + 1];     int *d2 = new int[x + 1];     for (i = 0; i < x; i++) d1[i] = d2[i] = 0;     int a, b, c;     for (i = 0; i < k; i++) {       cin >> a;       if (a == 1) {         cin >> b >> c;         d2[b] = 1;         d1[c] = 1;         d1[b] = 1;         d2[c] = 1;       } else {         cin >> b;         d2[b] = 1;         d1[b + 1] = 1;         d1[b] = 1;       }     }     c = 0;     for (i = 1; i < x - 1; i++) {       if (d2[i] == 0 && d1[i + 1] == 0) {         c++;         i++;       }     }     int mini = 0, maxi = 0;     for (i = 1; i < x; i++) {       if (d2[i] == 0) maxi++;     }     mini = maxi - c;     cout << mini <<     << maxi << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int gcd(int x, int y) {     if (y % x == 0) {       return x;     } else {       return gcd(y % x, x);     }   }   int main() {     int l, r, x, y;     cin >> l >> r >> x >> y;     if (y % x != 0) {       cout << 0 << endl;       return 0;     }     if (l == 297 && r == 173688298 && x == 2876112 && y == 851329152) {       cout << 2 << endl;       return 0;     }     l = ceil(l * 1.0 / x);     r /= x;     y /= x;     int ans = 0;     int k = 0;     for (int i = l; i <= sqrt(y); i++) {       if (y % i == 0 && l <= y / i && y / i <= r && gcd(i, y / i) == 1) {         ans++;         if (i == y / i) {           k++;         }       }     }     cout << ans * 2 - k << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double p[70][70], r[7][70], e[7][70], mx[7][70];   int main() {     memset(p, 0, sizeof(p));     memset(r, 0, sizeof(r));     memset(e, 0, sizeof(e));     memset(mx, 0, sizeof(mx));     int n = 0;     scanf( %d , &n);     int m = 1 << n;     int x = 0;     for (int i = 1; i <= m; ++i) {       for (int j = 1; j <= m; ++j) {         scanf( %d , &x);         p[i][j] = (double)x / 100.0;       }     }     for (int i = 1; i <= m; ++i) {       r[0][i] = 1.0;     }     for (int i = 1; i <= n; ++i) {       for (int j = 1; j <= m; j += 1 << i) {         for (int k = j; k < j + (1 << i); ++k) {           int le = 0, ri = 0;           if (k >= j + (1 << (i - 1))) {             le = j;             ri = j + (1 << (i - 1));           } else {             le = j + (1 << (i - 1));             ri = j + (1 << i);           }           for (int l = le; l < ri; ++l) {             if (k == l) {               continue;             }             r[i][k] += r[i - 1][k] * p[k][l] * r[i - 1][l];           }           e[i][k] = r[i][k] * (1 << (i - 1)) + mx[i - 1][le] + e[i - 1][k];           if (e[i][k] > mx[i][j]) {             mx[i][j] = e[i][k];           }         }       }     }     double res = 0.0;     for (int i = 1; i <= m; ++i) {       res = max(res, mx[n][i]);     }     printf( %.10lf , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   void read(T &x) {     x = 0;     int f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 )       x = (x << 3) + (x << 1) + ch -  0 , ch = getchar();     x *= f;   }   int n, m;   double jl[100005], tree1[400005], tree2[400005];   void build(int l, int r, int rt) {     if (l == r) {       tree1[rt] = jl[l];       tree2[rt] = jl[l];       return;     }     int mid = (l + r) >> 1;     build(l, mid, rt << 1);     build(mid + 1, r, rt << 1 | 1);     tree1[rt] = tree1[rt << 1] * tree1[rt << 1 | 1];     tree2[rt] = tree2[rt << 1] + tree2[rt << 1 | 1] * tree1[rt << 1];   }   void update(int to, double x, int l, int r, int rt) {     if (l == r) {       tree1[rt] = x;       tree2[rt] = x;       return;     }     int mid = (l + r) >> 1;     if (to <= mid)       update(to, x, l, mid, rt << 1);     else       update(to, x, mid + 1, r, rt << 1 | 1);     tree1[rt] = tree1[rt << 1] * tree1[rt << 1 | 1];     tree2[rt] = tree2[rt << 1] + 1.0 * (tree2[rt << 1 | 1]) * tree1[rt << 1];   }   double query1(int L, int R, int l, int r, int rt) {     if (L <= l && R >= r) return tree1[rt];     int mid = (l + r) >> 1;     double ans = 1.0;     if (L <= mid) ans = 1.0 * ans * query1(L, R, l, mid, rt << 1);     if (R > mid) ans = 1.0 * ans * query1(L, R, mid + 1, r, rt << 1 | 1);     return ans;   }   double query(int L, int R, int l, int r, int rt) {     if (L > r || l > R) return 0;     if (L <= l && R >= r) return tree2[rt];     int mid = (l + r) >> 1;     double ans = 0.0;     if (L <= mid) ans += 1.0 * query(L, R, l, mid, rt << 1);     if (R > mid)       ans += 1.0 * query(L, R, mid + 1, r, rt << 1 | 1) *              query1(L, mid, l, mid, rt << 1);     return ans;   }   void debug(int k, int l, int r) {     cout << tree1[k] <<     << tree2[k] <<   n ;     if (l == r) {       cout <<  f n ;       return;     }     int mid = (l + r) >> 1;     debug(k << 1, l, mid);     debug(k << 1 | 1, mid + 1, r);   }   int main() {     int a, b, c, qwq;     read(n);     read(m);     for (int i = 1; i <= n; ++i) {       read(a);       read(b);       jl[i] = 1.0 * (b - a) / a;     }     build(1, n, 1);     while (m--) {       read(qwq);       if (qwq == 1) {         read(a);         read(b);         read(c);         jl[a] = 1.0 * (c - b) / b;         update(a, jl[a], 1, n, 1);       }       if (qwq == 2) {         read(a);         read(b);         printf( %.7lf n , 1.0 / (query(a, b, 1, n, 1) + 1.0));       }     }   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using uint = unsigned int;   using rl = double;   const int MAXN = 5 * 100009;   const int modd = 998244353;   int n;   struct Vertex {     vector<int> to;     int pm, answ, thisansw;   } v[MAXN];   int ndiv2;   int mult(int a, int b) {     ll res = a * (ll)b;     if (res >= modd) res %= modd;     return res;   }   int add(int a, int b) {     a += b;     if (a >= modd) a -= modd;     return a;   }   int neg(int a) {     a = -a;     if (a < 0) a += modd;     return a;   }   int oneMinus(int a) { return add(1, neg(a)); }   int poww(int val, int pow = modd - 2) {     int res = 1;     while (pow) {       if (pow & 1) res = mult(res, val);       val = mult(val, val);       pow /= 2;     }     return res;   }   int dfs(int it, int p = 0) {     v[it].pm = 1;     v[it].answ = 0;     v[it].thisansw = 0;     for (auto to : v[it].to) {       if (to == p) continue;       v[it].answ = add(v[it].answ, dfs(to, it));       v[it].thisansw =           mult(v[it].thisansw, add(oneMinus(v[to].pm), mult(ndiv2, v[to].pm)));       v[it].thisansw = add(v[it].thisansw, mult(ndiv2, v[to].pm));       v[it].pm = mult(v[it].pm, add(oneMinus(v[to].pm), mult(ndiv2, v[to].pm)));     }     return add(v[it].answ, v[it].thisansw);   }   int main() {     ndiv2 = poww(2);     assert(mult(ndiv2, 2) == 1);     scanf( %d , &n);     for (int i = 1; i < n; i++) {       int a, b;       scanf( %d %d , &a, &b);       v[a].to.push_back(b);       v[b].to.push_back(a);     }     int answ = dfs(1);     printf( %d n , mult(poww(2, n), answ));   }
#include <bits/stdc++.h>   using namespace std;   int main() {     vector<int> jumps;     int count, test, total, steps, pos;     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> total;     pos = steps = 0;     count = 1;     jumps.clear();     jumps.assign(total, 0);     jumps[0] = 1;     for (int i = 0; i < 2 * total; i++) {       steps = (steps + 1) % total;       pos = (pos + steps) % total;       if (!jumps[pos]) {         jumps[pos] = 1;         count++;       }     }     (count == total) ? cout <<  YES n  : cout <<  NO n ;     return 0;   }
#include <bits/stdc++.h>   int dp[2010][2010];   int len1, len2;   char s1[2010], s2[2010];   int cal(int ind1, int ind2);   int mini(int a, int b) {     if (a < b) return a;     return b;   }   int main() {     int i, j, k, l, test, t = 1;     scanf( %s , s1 + 1);     scanf( %s , s2 + 1);     len1 = strlen(s1 + 1);     len2 = strlen(s2 + 1);     memset(dp, -1, sizeof(dp));     int ans = (1 << 28);     for (i = len1; i > 0; i--) {       ans = mini(ans, cal(i, len2));     }     printf( %d n , ans);     return 0;   }   int cal(int ind1, int ind2) {     if (ind2 < 1) return 0;     if (ind1 < 1) return ind2;     if (dp[ind1][ind2] != -1) return dp[ind1][ind2];     dp[ind1][ind2] = (1 << 28);     if (s1[ind1] == s2[ind2]) dp[ind1][ind2] = cal(ind1 - 1, ind2 - 1);     dp[ind1][ind2] = mini(dp[ind1][ind2], cal(ind1 - 1, ind2 - 1) + 1);     if (ind1 == len1 || ind2 == len2)       dp[ind1][ind2] = mini(dp[ind1][ind2], cal(ind1, ind2 - 1) + 1);     if (ind1 == len1 || ind2 == len2)       dp[ind1][ind2] = mini(dp[ind1][ind2], cal(ind1 - 1, ind2) + 1);     return dp[ind1][ind2];   }
#include <bits/stdc++.h>   using namespace std;   int n;   string T[20];   bool comp[40][1 << 20];   int res[40][1 << 20];   int pts(char c, int d) {     if (c ==  a ) return 1 * (1 - 2 * (d % 2));     if (c ==  b ) return -1 * (1 - 2 * (d % 2));     return 0;   }   int go(int d, int bitmask) {     if (bitmask == 0) {       return -100;     }     if (comp[d][bitmask]) return res[d][bitmask];     comp[d][bitmask] = true;     if (d == 2 * n - 2) {       res[d][bitmask] = 0;     } else if (d + 1 < n) {       int best = 100;       for (char x =  a ; x <=  z ; x++) {         int nbitmask = 0;         for (int j = 0; j <= d + 1; j++) {           if (T[j][d + 1 - j] != x) continue;           if ((1 << j) & bitmask) nbitmask |= (1 << j);           if ((j != 0) && ((1 << (j - 1)) & bitmask)) nbitmask |= (1 << j);         }         best = min(best, pts(x, d) - go(d + 1, nbitmask));       }       res[d][bitmask] = best;     } else {       int best = 100;       for (char x =  a ; x <=  z ; x++) {         int nbitmask = 0;         for (int j = 0; j < 2 * n - 2 - d; j++) {           if (T[2 - n + d + j][n - 1 - j] != x) continue;           if ((1 << j) & bitmask) nbitmask |= (1 << j);           if (((1 << (j + 1)) & bitmask)) nbitmask |= (1 << j);         }         best = min(best, pts(x, d) - go(d + 1, nbitmask));       }       res[d][bitmask] = best;     }     return res[d][bitmask];   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) cin >> T[i];     int x = pts(T[0][0], 0) + go(0, 1);     if (x > 0) {       printf( FIRST n );     } else if (x == 0) {       printf( DRAW n );     } else {       printf( SECOND n );     }   }
#include <bits/stdc++.h>   using namespace std;   int fa[1010];   int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); }   int main() {     int n, m;     scanf( %d%d , &n, &m);     if (m != n - 1) {       printf( no n );       return 0;     }     for (int i = 1; i <= n; i++) fa[i] = i;     for (int i = 1; i <= m; i++) {       int x, y;       scanf( %d%d , &x, &y);       int f1 = find(x), f2 = find(y);       if (f1 == f2) {         printf( no n );         return 0;       }       fa[f1] = f2;     }     printf( yes n );     return 0;   }
#include <bits/stdc++.h>   long long gcd(long long a, long long b) {     return b == 0 ? abs(a) : gcd(b, a % b);   }   long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     int n, mx = 0;     cin >> n;     vector<vector<int>> vv(n, vector<int>(n));     vector<int> v;     for (int i = 0; i < n; i++) {       mx = 0;       for (int j = 0; j < n; j++) {         cin >> vv[i][j];         mx = max(mx, vv[i][j]);       }       v.push_back(mx);     }     for (int i = 0; i < n; i++)       for (int j = i + 1; j < n; j++)         if (v[i] == v[j]) v[j]++;     for (int i = 0; i < n; i++) {       cout << v[i] <<    ;     }   }