malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int t, i, j, n, a[100000], x, y, index, num, l, r, count, count1,         temp;     vector<int> vect;     cin >> n >> t;     for (i = 0; i < n; i++) {       cin >> a[i];     }     while (t > 0) {       count = 0;       count1 = 0;       cin >> x >> y >> index;       index = index - 1;       x = x - 1;       y = y - 1;       if (x <= index && index <= y) {         for (i = index - 1; i >= x; i--) {           if (a[index] < a[i]) {             count++;           }         }         for (i = index + 1; i <= y; i++) {           if (a[index] > a[i]) {             count1++;           }         }         if (count == count1) {           temp = 1;         } else {           temp = 0;         }       } else {         temp = 1;       }       if (temp == 1) {         cout <<  Yes  << endl;       } else {         cout <<  No  << endl;       }       t--;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int max_n = 300000;   int a[max_n], b[max_n], p[max_n];   int main() {     int n;     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       a[i]--;     }     for (int i = 0; i < n; i++) {       int t;       scanf( %d , &t);       t--;       b[t] = i;     }     int res = n;     for (int i = 0; i < n; i++, res--) {       p[i] = b[a[i]];       if (i && p[i - 1] > p[i]) {         break;       }     }     printf( %d n , res);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string rs(string s) {     for (int i = 0; i < s.size(); i++) {       if (s[i] ==    ) s.erase(i, 1);     }     return s;   }   int main() {     char s[1100000];     vector<string> v;     while (gets(s)) {       v.push_back(s);     }     vector<bool> mag(v.size(), false);     for (int i = 0; i < v.size(); i++) {       for (int j = 0;; j++) {         if (v[i][j] !=  #  && v[i][j] !=    )           break;         else if (v[i][j] ==  # ) {           mag[i] = true;           break;         }       }     }     int i = 0;     string con;     while (i < mag.size()) {       if (mag[i]) {         cout << v[i];         cout << endl;       } else {         con =   ;         while (!mag[i] && i < mag.size()) {           con += v[i];           i++;         }         for (int j = 0; j < con.size(); j++)           if (con[j] !=    ) cout << con[j];         cout << endl;         i--;       }       i++;     }   }
#include <bits/stdc++.h>   using namespace std;   const long long mod = 1e9 + 7;   const long long N = 50;   const long long INF = 1e10;   vector<string> mat(N);   int n, r1, c1, r2, c2;   vector<vector<bool>> visited(N, vector<bool>(N));   void dfs(int i, int j, vector<pair<int, int>> &s) {     visited[i][j] = true;     s.push_back({i, j});     if (i + 1 < n and !visited[i + 1][j] and mat[i + 1][j] ==  0 )       dfs(i + 1, j, s);     if (i - 1 >= 0 and !visited[i - 1][j] and mat[i - 1][j] ==  0 )       dfs(i - 1, j, s);     if (j + 1 < n and !visited[i][j + 1] and mat[i][j + 1] ==  0 )       dfs(i, j + 1, s);     if (j - 1 >= 0 and !visited[i][j - 1] and mat[i][j - 1] ==  0 )       dfs(i, j - 1, s);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     vector<pair<int, int>> s, f;     cin >> n >> r1 >> c1 >> r2 >> c2;     for (int i = 0; i < n; i++) cin >> mat[i];     dfs(r1 - 1, c1 - 1, s);     if (!visited[r2 - 1][c2 - 1]) dfs(r2 - 1, c2 - 1, f);     if (f.size() == 0) {       cout << 0;       return 0;     }     int ans = INT_MAX;     for (auto i : s) {       for (auto j : f)         ans = min(ans, (i.first - j.first) * (i.first - j.first) +                            (i.second - j.second) * (i.second - j.second));     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1000000000;   int main() {     int hy, ay, dy;     int hm, am, dm;     int ph, pa, pd;     scanf( %d%d%d%d%d%d%d%d%d , &hy, &ay, &dy, &hm, &am, &dm, &ph, &pa, &pd);     int ans = INF, least = 0;     int cur_ay = ay;     if (cur_ay < dm + 1) {       least = pa * (dm + 1 - cur_ay);       cur_ay = dm + 1;     }     int tar_ay, tar_dy;     int c1, c2;     for (int k = 1; k <= 100; k++) {       c1 = least;       tar_ay = dm + hm / k + (hm % k ? 1 : 0);       if (tar_ay > cur_ay) c1 += (tar_ay - cur_ay) * pa;       tar_dy = am - hy / k + (hy % k ? 0 : 1);       if (tar_dy <= dy)         ans = min(ans, c1);       else {         for (int j = 0; dy + j < tar_dy; j++) {           c2 = c1 + j * pd + (k * (am - dy - j) - hy + 1) * ph;           if (c2 < ans) ans = c2;         }         ans = min(c1 + (tar_dy - dy) * pd, ans);       }     }     if (ans == INF) ans = 0;     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[] = {0, 0, 1, -1};   int dy[] = {1, -1, 0, 0};   bool valid(int x, int y) {       return x >= 0 && y >= 0 && x < 3 && y < 3 ? 1 : 0;   }      int main()   {       ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);       int t;       cin >> t;       while (t--) {           int n, k;           cin >> n >> k;           int arr[n];           for (int i = 0; i < n; ++i) {               cin >> arr[i];           }           sort(arr, arr + n);           int mx = arr[n - 1], mex = 0;           for (int i = 0; i < n; ++i) {               if (mex == arr[i]) {                   ++mex;               } else {                   break;               }           }           if (k) {               if (mex > mx) {                   n += k;               } else {                   int x = mex + mx;                   int y = x / 2;                   y += (x % 2);                   if (!binary_search(arr, arr + n, y)) {                       ++n;                   }               }           }           cout << n <<   n ;       }          return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     string s;     cin >> s;     int ans = 0;     int n = s.size();     for (int i = 0; i < n; i++) ans += (1 << i);     for (int i = 0; i < n; i++) {       if (s[i] ==  7 ) ans += (1 << (n - i - 1));     }     cout << ans;   }
/*There is no salvation without suffering*/   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   #include<iostream>   #include<string>   #include<algorithm>   #include<numeric>   #include<cmath>   #include<vector>   #include<iomanip>   #include<map>   #include<set>   #include<stack>   #include<queue>   #include<utility>   #include<iterator>   using namespace std;   #define ll long long   #define pb push_back   #define pf push_front   #define mp make_pair   #define tt ll t;cin>>t;while(t--)   #define nn cout<<endl;   #define ff(i,a,n) for(ll i=a;i<n;i++)   #define f(i,n,a) for(ll i=n;i>=a;i--)   #define fr(x, a) for(auto &x:a)   #define F(a) for(auto &x:a) cin>>x   #define cY cout<< YES n    #define cN cout<< NO n    #define cy cout<< Yes n    #define cn cout<< No n    #define sc second   #define fs first   #define c(a) cout<<a<<endl   #define all(a) a.begin(),a.end()   #define pi 3.14159265359   ll M=1e9+7;   ll mod(ll x){return ((x%M+M)%M);}   ll gcd(ll a,ll b);   ll lcm(ll a,ll b);   bool prime(ll n);   ll BinExp(ll base,ll power);   ll ModInverse(ll base);   ll nCr(ll n,ll r);   ll fact(ll n){ return (n<=1)? 1 : n*fact(n-1);}       /* Read the damn question carefully*/   void solve()   {    ll n; cin>>n;    string a,b; cin>>a>>b;    ll o=count(all(a), 1 ),z=n-o;    ll x=0;    bool ans=true;   // c(o<<   <<z);    for(ll i=n-1;i>=0;i--)    {     if(x==0)     {      if(a[i]!=b[i])      {       if(o==z)       {        x=1-x;        if(a[i]== 1 )        {         a[i]= 0 ; z--;        }        else        {         a[i]= 1 ; o--;        }       }       else       {        ans=false; break;       }      }      else      {       if(a[i]== 0 )        z--;       else o--;      }     }     else     {      if(a[i]== 1 )       a[i]= 0 ;      else a[i]= 1 ;      if(a[i]!=b[i])      {       if(o==z)       {        x=1-x;        if(a[i]== 1 )        {         a[i]= 0 ; z--;        }        else        {         a[i]= 1 ; o--;        }       }       else       {        ans=false; break;       }      }      else      {       if(a[i]== 0 )        z--;       else o--;      }     }    }   // c(a);    if(ans)     cY;    else cN;       }       int main()   {    ios::sync_with_stdio(false);    cin.tie(0); cout.tie(0);    tt    solve();   }   /*               */   ll nCr(ll n,ll r)   {    r=(n-r<=r) ? n-r : r;    ll ans=1;    for(ll i=0;i<r;i++)    {     ans*=(n-i);     ans/=(i+1);    }    return ans;   }   ll gcd(ll a,ll b){    if(a==0) return b;    return (a==1) ? a:gcd(b%a,a);   }    ll lcm(ll a,ll b) {return (a/gcd(a,b))*b; }   bool prime(ll n){    if(n<2) return false;    for(ll i=2;i<=sqrt(n);i++)     if(n%i==0)      return false;    return true;   }   ll BinExp(ll base,ll power){    if(!power)     return 1;    ll res=1;    while(power>1){     if(power%2){      power--;      res*=base;     }     else{      base*=base;      power/=2;     }    }    return base*res;   }   ll ModInverse(ll base){    ll power=M-2;    if(!power)     return 1;    ll res=1;    while(power>1){     if(power%2){      power--;      res=mod(res*base);     }     else{      base=mod(base*base);      power/=2;     }    }    return mod(base*res);   }
#include <bits/stdc++.h>   using namespace std;   int Mod;   const int Nmax = 1005, Kmax = 105;   int Dp[Nmax][Kmax];   int main() {     ios::sync_with_stdio(false);     int N, K;     cin >> N >> K >> Mod;     for (int i = 1; i < 10; ++i) Dp[1][i % K]++;     if (N > 1) Dp[1][K] = 1;     for (int i = 2, pw = 10 % K; i <= N; ++i) {       for (int j = 1; j <= K; ++j) {         for (int k = i == N ? 1 : 0; k < 10; ++k) {           int nj = (1LL * pw * k + j) % K;           Dp[i][nj] = (Dp[i][nj] + Dp[i - 1][j]) % Mod;         }       }       Dp[i][K] = 1;       pw = 10LL * pw % K;     }     int ans = 0, pw = 1;     for (int i = 1; i < N; ++i) {       pw = 10LL * pw % Mod;     }     pw = 9LL * pw % Mod;     for (int i = 1; i < K; ++i) ans = (ans + Dp[N][i]) % Mod;     ans = (pw - ans + Mod) % Mod;     cout << ans <<   n ;   }
#include<bits/stdc++.h>   using namespace std;   #pragma GCC target ( avx2 )   #pragma GCC optimize ( Ofast )   #pragma GCC optimize ( unroll-loops )   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimize( O3 )   #define F first   #define S second   #define sz size()   #define pb push_back   #define int long long   #define all(x) (x).begin(),(x).end()   #define NFS ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) ;   #define file(s) if (fopen(s .in ,  r )) freopen(s .in ,  r , stdin), freopen(s .out ,  w , stdout);   template <class T> inline T pw(T a, int n,  T res = 1){while (n) {if (n & 1) res *= a;a *= a;n >>= 1;}return res;}   template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; }   template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os <<  { ; for (auto v : vec) os << v <<  , ; os <<  } ; return os; }   const int E = 1e6+777;   const int inf = 1e18+777;   const int N = 1e5+777;   const bool O = 0;   const bool I = 1;   signed main(){auto solve=[&](){    int n;    cin >> n;    map<int,int>mp;    for(int i = 1, x; i <= n; i++){     cin >> x;     mp[x]++;    }    int ans = n & 1;    for(auto i : mp){     if(i.S > n / 2){      ans = i.S - (n - i.S);     }    }    cout << ans <<   n ;   };if(O)NFS;if(I){int T;cin>>T;while(T--)solve();exit(0);}solve();}
#include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC optimize( Ofast )   using namespace std;   vector<vector<int> > vec;   set<vector<int> > myset, vis;   map<vector<int>, int> p;   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m, t, a, b;     cin >> n >> m >> t;     vec.resize(n);     while (m--) {       cin >> a >> b;       a--, b--;       vec[a].push_back(b);       vec[b].push_back(a);     }     while (t--) {       cin >> m >> a >> b;       m--, a--, b--;       myset.insert({m, a, b});     }     vector<int> state, ans;     queue<vector<int> > q;     bool ok = 0;     for (auto it : vec[0]) {       if (it == (n - 1)) {         cout << 1 <<   n  << 1 <<     << n <<   n ;         return 0;       }       q.push({0, it}), vis.insert({0, it});     }     while (!q.empty()) {       vector<int> f = q.front();       q.pop();       for (auto it : vec[f[1]]) {         if (myset.find({f[0], f[1], it}) != myset.end()) continue;         if (vis.find({f[1], it}) != vis.end()) continue;         if (it == (n - 1)) {           ok = 1, state = f;           break;         }         q.push({f[1], it});         p[{f[1], it}] = f[0];         vis.insert({f[1], it});       }       if (ok) break;     }     if (!ok) {       cout << -1;       return 0;     }     ans.push_back(state[1]);     int c = 100005;     while ((state[0] != 0)) {       ans.push_back(state[0]);       t = p[state];       state[1] = state[0], state[0] = t;     }     reverse(ans.begin(), ans.end());     cout << ans.size() + 1 <<   n1  ;     for (auto it : ans) cout << it + 1 <<    ;     cout << n <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long n, c;     cin >> n >> c;     vector<long long> a(n);     multiset<long long> p;     for (long long i = 0; i < n; i++) {       cin >> a[i];     }     for (long long i = 0; i < n; i++) {       long long x;       cin >> x;       p.insert(x);     }     long long np = a[c - 1] + *p.rbegin(), ans = 1;     auto it = p.end();     it--;     p.erase(it);     for (long long i = 0; i < n; i++) {       if (i == c - 1) continue;       long long x = np - a[i];       auto f = p.upper_bound(x);       if (f != p.begin()) {         f--;         p.erase(f);       } else {         ans++;       }     }     cout << ans <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const double eps = 1e-9;   int n, m, l, r;   int main() {     int T, cas = 1, x = INF;     scanf( %d%d , &n, &m);     for (int i = 1; i <= m; ++i) {       scanf( %d%d , &l, &r);       x = min(x, r - l + 1);     }     printf( %d n , x);     for (int i = 1; i <= n; ++i) printf( %d%c , i % x, i == n ?   n  :    );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int T;     scanf( %d , &T);     while (T--) {       int a[255];       int s = 0;       for (int i = 0; i < 250; i++) {         scanf( %d , &a[i]);         s += a[i];       }       double ave = s / 250.0;       int cnt = 0;       for (int i = 0; i < 250; i++) {         if (fabs(a[i] - ave) <= ave / 2) cnt++;       }       if (cnt > 250 * 0.75)         puts( poisson );       else         puts( uniform );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   ostream& prnt(ostream& out, T v) {     out << v.size() <<   n ;     for (auto e : v) out << e <<    ;     return out;   }   template <class T>   ostream& operator<<(ostream& out, vector<T> v) {     return prnt(out, v);   }   template <class T>   ostream& operator<<(ostream& out, set<T> v) {     return prnt(out, v);   }   template <class T1, class T2>   ostream& operator<<(ostream& out, map<T1, T2> v) {     return prnt(out, v);   }   template <class T1, class T2>   ostream& operator<<(ostream& out, pair<T1, T2> p) {     return out <<  (  << p.first <<     << p.second <<  ) ;   }   const int N = 100100;   const int MOD = 666013;   int n, k, m, g[N], ans, s, a, b;   int main() {     ios_base::sync_with_stdio(false);     cin >> n >> s;     for (int i = 1; i < n; i++) {       cin >> a >> b;       g[a]++;       g[b]++;     }     for (int i = 1; i <= n; i++)       if (g[i] == 1) ans++;     cout << fixed << setprecision(7);     cout << 2. * s / ans <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   int n, f = -1;   int main() {     cin >> n;     cout << (n * n + 1) / 2;     for (int i = 0; i < n; i++) {       f = f * (-1);       cout << endl;       for (int j = 0; j < n; j += 2) {         if (f == 1) {           if (j != n - 1)             cout <<  C. ;           else             cout <<  C ;         } else {           if (j != n - 1)             cout <<  .C ;           else             cout <<  . ;         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int L01P08(vector<int>& arr, int n) {     bool check = true;     if (arr[0] - 15 > 0) {       return 15;     } else {       for (int i = 0; i < n - 1; i++) {         for (int j = 1; j < n; j++) {           if (arr[i] + 15 < arr[i + 1]) {             return arr[i] + 15;             break;           }         }       }       if (arr[arr.size() - 1] + 15 < 90) {         return arr[arr.size() - 1] + 15;       } else {         return 90;       }     }   }   int main() {     int n, val;     cin >> n;     vector<int> arr;     for (int i = 0; i < n; i++) {       cin >> val;       arr.push_back(val);     }     int res = L01P08(arr, n);     cout << res;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<long long> adj[200005];   vector<long long> vis(200005);   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long i, j, k = 0, n, t = 1, m, l = 0;     for (i = 0; i < 200005; i++) vis[i] = 0;     while (t--) {       cin >> n;       for (i = 0; i < n; i++) {         cin >> l >> m;         adj[m].push_back(l);         adj[l].push_back(m);       }       long long d[n + 1];       for (i = 0; i <= n; i++) d[i] = 100000000000;       queue<long long> q;       d[1] = 0;       q.push(1);       vis[1] = 1;       long long farthest = -1;       while (!q.empty()) {         long long s = q.front();         q.pop();         for (auto u : adj[s]) {           if (vis[u]) continue;           vis[u] = 1;           d[u] = d[s] + 1;           farthest = u;           q.push(u);         }       }       long long par[n + 1];       for (i = 0; i <= n; i++) par[i] = -1;       for (i = 0; i <= n; i++) {         d[i] = 100000000000;         vis[i] = 0;       }       d[farthest] = 0;       q.push(farthest);       vis[farthest] = 1;       long long farthest1 = -1;       while (!q.empty()) {         long long s = q.front();         q.pop();         for (auto u : adj[s]) {           if (vis[u]) continue;           vis[u] = 1;           d[u] = d[s] + 1;           par[u] = s;           farthest1 = u;           q.push(u);         }       }       for (i = 0; i <= n; i++) vis[i] = 0;       long long node = farthest1;       while (node != farthest) {         vis[node] = 1;         node = par[node];       }       vis[node] = 1;       long long ans = d[farthest1];       for (i = 1; i <= n; i++) {         d[i] = 0;         if (vis[i] == 1) {           q.push(i);         }       }       long long farthest2 = -1;       while (!q.empty()) {         long long s = q.front();         q.pop();         for (auto u : adj[s]) {           if (vis[u]) continue;           vis[u] = 1;           d[u] = d[s] + 1;           par[u] = s;           farthest2 = u;           q.push(u);         }       }       if (farthest2 != -1)         ans += d[farthest2];       else {         for (i = 1; i <= n; i++) {           if (i != farthest1 && i != farthest) {             farthest2 = i;             break;           }         }       }       cout << ans <<   n ;       cout << farthest2 <<     << farthest1 <<     << farthest <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long int MOD = 1e9 + 7;   long long int ne;   long long int go(long long int idx, long long int pre) {     if (idx == ne) return 0;     long long int ans = 1e15;     if (idx == 0)       ans = min(ans, 1 + go(idx + 1, 0));     else {       if (idx == 3) {         if (pre != 1) ans = min(ans, go(idx + 1, 1));         if (pre != 2) ans = min(ans, go(idx + 1, 2));       } else if (idx == 1) {         if (pre != 1) ans = min(ans, go(idx + 1, 1));       } else {         if (pre != 2) ans = min(ans, go(idx + 1, 2));       }       ans = min(ans, 1 + go(idx + 1, 0));     }   }   long double k, d, t;   long double kk, dl, dd, tt, tc;   long double kectotal, tnow, ans;   long double prnow, kebnow;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cin >> k >> d >> t;     kk = ceil(k / d);     dd = kk * d;     dl = dd - k;     tt = 1 / (2 * t);     tt = dl * tt;     tc = k / t;     kectotal = tt + tc;     tnow = floor(1.0 / kectotal);     ans = (tnow * dd);     prnow = tnow * kectotal;     kebnow = 1.0 - prnow;     if (kebnow <= 0.000000000) {     } else if (kebnow <= tc) {       ans += ((kebnow / tc) * k);       kebnow -= kebnow;     } else if (kebnow > tc) {       ans += k;       kebnow -= tc;     }     if (kebnow <= 0.000000000) {     } else if (kebnow <= tt) {       ans += ((kebnow / tt) * dl);       kebnow -= kebnow;     }     cout << fixed << setprecision(11) << ans << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   static const double EPS = 1e-8;   int main() {     istream &fin = cin;     ostream &fout = cout;     FILE *fpin = stdin;     FILE *fpout = stdout;     string s;     fin >> s;     bool p = true;     string res;     for (int i = s.size() - 1; i >= 0; i--) {       if (p && s[i] ==  / ) continue;       if (s[i] !=  / )         p = false;       else         p = true;       res.push_back(s[i]);     }     reverse(res.begin(), res.end());     if (res.empty()) res =  / ;     fout << res << endl;   }
#include <bits/stdc++.h>   using namespace std;   template <class T>   inline T gcd(T a, T b) {     if (a < 0) return gcd(-a, b);     if (b < 0) return gcd(a, -b);     return (b == 0) ? a : gcd(b, a % b);   }   template <class T>   inline T lcm(T a, T b) {     if (a < 0) return lcm(-a, b);     if (b < 0) return lcm(a, -b);     return a * (b / gcd(a, b));   }   template <class T>   T power(T N, T P) {     return (P == 0) ? 1 : N * power(N, P - 1);   }   long long toInt64(string s) {     long long r = 0;     istringstream sin(s);     sin >> r;     return r;   }   double LOG(long long N, long long B) { return (log10l(N)) / (log10l(B)); }   string itoa(long long a) {     if (a == 0) return  0 ;     string ret;     for (long long i = a; i > 0; i = i / 10) ret.push_back((i % 10) + 48);     reverse(ret.begin(), ret.end());     return ret;   }   vector<string> token(string a, string b) {     const char *q = a.c_str();     while (count(b.begin(), b.end(), *q)) q++;     vector<string> oot;     while (*q) {       const char *e = q;       while (*e && !count(b.begin(), b.end(), *e)) e++;       oot.push_back(string(q, e));       q = e;       while (count(b.begin(), b.end(), *q)) q++;     }     return oot;   }   int Set(int N, int pos) { return N = N | (1 << pos); }   int reset(int N, int pos) { return N = N & ~(1 << pos); }   int check(int N, int pos) { return (bool)(N & (1 << pos)); }   int toggle(int N, int pos) {     if (check(N, pos)) return N = reset(N, pos);     return N = Set(N, pos);   }   void pbit(int N) {     printf( ( );     for (int i = 10; i >= 0; i--) {       bool x = check(N, i);       cout << x;     }     puts( ) );   }   int fx[] = {0, 0, 1, -1, 1, -1, 1, -1};   int fy[] = {-1, 1, 0, 0, -1, -1, 1, 1};   int main() {     int n;     cin >> n;     int u = 1, c = 1;     for (int i = 1; i <= (int)n - 1; i++) {       for (int j = 1; j <= (int)c; j++) {         u++;         if (u > n) u = 1;       }       cout << u <<    ;       c++;     }     puts(  );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, h, m;     int cash[2360] = {0};     scanf( %d , &n);     for (int i = 0; i < n; i++) {       scanf( %d %d , &h, &m);       h *= 100;       h += m;       cash[h]++;     }     sort(cash, cash + 2360, greater<int>());     printf( %d n , cash[0]);     return 0;   }