malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int a[100500];   vector<int> gr[100500];   int n, m, s, k;   int res[100500][101];   int d[100500];   int q[100500];   int A[100500];   int B[100500];   int sz[100500];   int main() {     scanf( %d %d %d %d , &n, &m, &k, &s);     for (int i = 1; i <= n; ++i) {       scanf( %d , a + i);       int u = n + a[i];       gr[u].push_back(i);     }     for (int i = 0; i < m; i++) {       int c, b;       scanf( %d %d , &c, &b);       A[i] = c;       B[i] = b;       sz[c]++;       sz[b]++;     }     for (int i = 1; i <= n; i++) gr[i].resize(sz[i]);     for (int i = 0; i < m; i++) {       gr[A[i]][--sz[A[i]]] = B[i];       gr[B[i]][--sz[B[i]]] = A[i];     }     for (int i = 1; i <= k; ++i) {       int ql = 0, qr = 0;       for (int j = 1; j <= n; ++j) {         if (a[j] != i)           d[j] = 1e9;         else {           d[j] = 0;           q[qr++] = j;         }       }       while (ql <= qr) {         auto x = q[ql++];         res[x][i - 1] = d[x];         for (auto v : gr[x]) {           if (d[v] >= 1e9) {             d[v] = 1 + d[x];             q[qr++] = v;           }         }       }     }     for (int i = 1; i <= n; i++) {       sort(res[i], res[i] + k);       int w = 0;       for (int j = 0; j < s; ++j) {         w += res[i][j];       }       cout << w <<    ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string s[101][2];   int n, m;   int main() {     cin >> n;     m = 0;     for (int i = 1; i <= n; i++) {       bool mark = true;       m++;       cin >> s[m][0] >> s[m][1];       for (int j = 1; j < m; j++)         if ((s[m][0] == s[j][0]) && (s[m][1] == s[j][1])) {           mark = false;           break;         }       if (!mark) {         m--;       }     }     cout << m << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int N;   int main() {     cin >> N;     cout << N / 2 <<   n ;     for (int i = 0; i < N / 2 - 1; i++) {       cout <<  2  ;     }     if (N % 2 == 0)       cout <<  2 n ;     else       cout <<  3 n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int N[100000 + 100];   long long int ans = 0;   int main() {     int n;     cin >> n;     int court = 0;     int court_1 = 0;     int court_2 = 0;     for (int i = 0; i < n; ++i) cin >> N[i];     for (int i = 0; i < n; ++i) {       if (N[i] < -1) {         ans += -1 - N[i];         N[i] = -1;         ++court_2;       } else if (N[i] > 1) {         ans += N[i] - 1;         N[i] = 1;         ++court_1;       } else if (N[i] == 0) {         court++;       } else if (N[i] == 1) {         court_1++;       } else if (N[i] == -1) {         court_2++;       }     }     if (court_2 % 2 != 0) {       if (court != 0) {         ans += 1;         court--;       } else if (court == 0) {         if (court_1 != 0) {           court_1--;           ans += 2;         } else if (court_1 == 0) {           ans += 2;         }       }     }     if (court != 0) ans += court;     cout << ans << endl;   }
#include <bits/stdc++.h>   using namespace std;   int n, t[200005], ans = 0;   bool chk[200005];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d , t + i);     chk[0] = true;     for (int i = n; i >= 1; i--)       if (!chk[i]) {         int x = i;         ans++;         while (!chk[x]) chk[x] = true, x = t[x];       }     printf( %d n , ans);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     for (int i = 0; i < t; i++) {       int x, y, z;       cin >> x >> y >> z;       if (x != y && y != z && z != x)         cout <<  NO               <<   n ;       else {         int a = min(min(x, y), z);         int c = max(max(x, y), z);         int b = x + y + z - a - c;         if (a == c || b == c)           cout <<  YES                 <<   n                 << min(a, b) <<     << min(a, b) <<     << c <<   n ;         else if (a == b) {           if (b == c)             cout <<  YES                   <<   n                   << a <<     << b <<     << c <<   n ;           else             cout <<  NO                   <<   n ;         }       }     }   }
#include <bits/stdc++.h>   using namespace std;   long long ppow(long long a, long long b) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a) % 998244353;       a = (a * a) % 998244353;       b >>= 1;     }     return res;   }   struct st {     long long c, x, y;   };   long long sum[2000000];   long long x_2[2000000];   long long xx[2000000];   long long y_2[2000000];   long long yy[2000000];   long long ans[2000000];   signed main() {     int n, m;     scanf( %d%d , &n, &m);     vector<st> v;     for (int i = 0; i < (n); i++)       for (int j = 0; j < (m); j++) {         int a;         scanf( %d , &a);         v.push_back({a, i, j});       }     int r, c;     scanf( %d%d , &r, &c);     r--;     c--;     sort(v.begin(), v.end(), [](st a, st b) { return a.c < b.c; });     for (int i = 0; i < (v.size()); i++) {       st a = v[i];       int j = lower_bound(v.begin(), v.end(), v[i],                           [](st a, st b) { return a.c < b.c; }) -               v.begin();       if (j == 0) {         ans[i] = 0;       } else {         j--;         ans[i] = (sum[j] + x_2[j] * a.x + xx[j] + (a.x * a.x) * (j + 1) +                   y_2[j] * a.y + yy[j] + (a.y * a.y) * (j + 1)) %                  998244353 * ppow(j + 1, 998244353 - 2) % 998244353;       }       sum[i] = ans[i];       x_2[i] = (-2 * a.x + 998244353) % 998244353;       xx[i] = a.x * a.x;       y_2[i] = (-2 * a.y + 998244353) % 998244353;       yy[i] = a.y * a.y;       if (i) {         (sum[i] += sum[i - 1]) %= 998244353;         (x_2[i] += x_2[i - 1]) %= 998244353;         (xx[i] += xx[i - 1]) %= 998244353;         (y_2[i] += y_2[i - 1]) %= 998244353;         (yy[i] += yy[i - 1]) %= 998244353;       }       if (a.x == r && a.y == c) {         cout << ans[i] % 998244353 << endl;         return 0;       }     }   }
#include <bits/stdc++.h>   using namespace std;   ifstream in( file.in );   ofstream out( file.out );   struct om {     int p, t, id;   } a[100005], b[100005];   int n, w, h, cnt1[200005], cnt2[200005], ans[100005], v[200005], k, m, first,       nibab[100005];   pair<int, int> fk[100005];   queue<int> q[200005];   bool comp(om a, om b) { return a.p < b.p; }   int main() {     ios_base ::sync_with_stdio(0);     cin.tie();     cin >> n >> w >> h;     for (int i = 1; i <= n; i++) {       cin >> first;       if (first == 1) {         k++;         cin >> a[k].p >> a[k].t;         a[k].id = i;         cnt1[a[k].t - a[k].p + 100000]++;       } else {         m++;         cin >> b[m].p >> b[m].t;         b[m].id = i;         cnt2[b[m].t - b[m].p + 100000]++;       }     }     sort(a + 1, a + k + 1, comp);     sort(b + 1, b + m + 1, comp);     for (int i = m; i >= 1; i--) {       q[b[i].t - b[i].p + 100000].push(b[i].id);     }     for (int i = 1; i <= k; i++) {       q[a[i].t - a[i].p + 100000].push(a[i].id);     }     for (int i = 1; i <= k; i++) {       ans[a[i].id] = q[a[i].t - a[i].p + 100000].front();       q[a[i].t - a[i].p + 100000].pop();     }     for (int i = m; i >= 1; i--) {       while (q[b[i].t - b[i].p + 100000].size())         q[b[i].t - b[i].p + 100000].pop();     }     for (int i = 1; i <= k; i++) {       while (q[a[i].t - a[i].p + 100000].size())         q[a[i].t - a[i].p + 100000].pop();     }     for (int i = k; i >= 1; i--) {       q[a[i].t - a[i].p + 100000].push(a[i].id);     }     for (int i = 1; i <= m; i++) {       q[b[i].t - b[i].p + 100000].push(b[i].id);     }     for (int i = 1; i <= m; i++) {       ans[b[i].id] = q[b[i].t - b[i].p + 100000].front();       q[b[i].t - b[i].p + 100000].pop();     }     for (int i = 1; i <= n; i++) nibab[ans[i]] = i;     for (int i = 1; i <= k; i++) {       fk[a[i].id] = {a[i].p, h};     }     for (int i = 1; i <= m; i++) {       fk[b[i].id] = {w, b[i].p};     }     for (int i = 1; i <= n; i++) {       cout << fk[nibab[i]].first <<     << fk[nibab[i]].second <<   n ;     }   }
#include <bits/stdc++.h>   using namespace std;   template <class n, class second>   ostream &operator<<(ostream &p, pair<n, second> x) {     return p <<  <  << x.first <<  ,   << x.second <<  > ;   }   template <class n>   auto operator<<(ostream &p, n y) ->       typename enable_if<!is_same<n, string>::value,                          decltype(y.begin(), p)>::type {     int o = 0;     p <<  { ;     for (auto c : y) {       if (o++) p <<  ,  ;       p << c;     }     return p <<  } ;   }   void dor() { cerr <<   n ; }   template <class n, class... second>   void dor(n p, second... y) {     cerr << p <<    ;     dor(y...);   }   template <class n, class second>   void mini(n &p, second y) {     if (p > y) p = y;   }   template <class n, class second>   void maxi(n &p, second y) {     if (p < y) p = y;   }   int main() {     vector<vector<int> > res;     string second;     cin >> second;     while (1) {       if (second.size() == 0) break;       int wsk = second.size() - 1;       vector<int> act;       for (int i = 0; i < (int)(second.size()); ++i) {         ;         if (second[i] ==  ( ) {           while (wsk > i && second[wsk] !=  ) ) {             wsk--;           }           if (wsk <= i) break;           act.push_back(i);           act.push_back(wsk);           second[i] =    ;           second[wsk] =    ;         }       }       if (act.size() == 0) break;       res.push_back(act);     }     sort((res).begin(), (res).end());     if (res.size() == 0)       cout << 0 <<   n ;     else {       cout << res.size() <<   n ;       for (auto j : res) {         sort((j).begin(), (j).end());         cout << j.size() <<   n ;         for (auto i : j) cout << i + 1 <<    ;         cout <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const int N = 2e5 + 5;   vector<int> basis;   void add(int x) {     for (int& a : basis)       if (a & -a & x) x ^= a;     if (x == 0) return;     for (int& a : basis)       if (x & -x & a) a ^= x;     basis.emplace_back(x);   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int x = 0;     int n;     cin >> n;     for (int i = 1; i <= n; ++i) {       int a;       cin >> a;       add(x ^= a);     }     if (x)       cout << basis.size();     else       cout <<  -1 ;   }
#include <bits/stdc++.h>   using namespace std;   const int mod = (int)1e9 + 7;   int pw(int a, int b) {     if (b == 0) return 1;     long long t = pw(a, b / 2);     t = (t * t) % mod;     if (b % 2) t = (t * a) % mod;     return t;   }   int arr[26];   int main() {     int n, i, j;     string str;     cin >> n >> str;     for (i = 0; i < n; i++) arr[str[i] -  A ]++;     int mx = 0;     for (i = 0; i < 26; i++) mx = max(mx, arr[i]);     int k = 0;     for (i = 0; i < 26; i++) {       if (arr[i] == mx) k++;     }     cout << pw(k, n) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long modpow(long long a, long long b,                    long long mod = (long long)(1e9 + 7)) {     if (!b) return 1;     a %= mod;     return modpow(a * a % mod, b / 2, mod) * (b & 1 ? a : 1) % mod;   }   mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());   const int mxn = 1e6;   const long long infty = 1e18;   int n, a, b, p;   int x[mxn];   vector<int> primes;   long long dp[mxn][3];   long long cost(int i) {     return x[i] % p ? (x[i] % p == 1 || x[i] % p + 1 == p ? b : infty) : 0;   }   long long dpsolve() {     for (int i = 0; i < n; i++)       for (int j = 0; j < 3; j++) dp[i][j] = infty;     dp[0][0] = dp[0][2] = cost(0);     dp[0][1] = a;     for (int i = 0; i < n - 1; i++)       for (int j = 0; j < 3; j++)         if (dp[i][j] < infty)           for (int k = j; k <= 2; k++) {             if (k == 1)               (dp[i + 1][k]) = min((dp[i + 1][k]), (dp[i][j] + a));             else               (dp[i + 1][k]) = min((dp[i + 1][k]), (dp[i][j] + cost(i + 1)));           }     long long ans = infty;     for (int k = 0; k < 3; k++) (ans) = min((ans), (dp[n - 1][k]));     return ans;   }   inline void getPrime(int temp) {     for (long long p = 2; p * p <= temp; p++)       if (temp % p == 0) {         primes.push_back(p);         while (temp % p == 0) temp /= p;       }     if (temp > 1) primes.push_back(temp);   }   void solve() {     scanf( %d , &n);     scanf( %d , &a);     scanf( %d , &b);     for (int i = 0; i < n; i++) scanf( %d , &x[i]);     for (int d = -1; d <= 1; d++) getPrime(x[0] + d), getPrime(x[n - 1] + d);     long long ans = infty;     for (int pp : primes) p = pp, (ans) = min((ans), (dpsolve()));     cout << ans << endl;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     long long T;     cin >> T;     while (T--) {       long long n;       cin >> n;       long long ans = 0;       long long one = 0, two = 0;       for (int i = 1; i <= n; i++) {         long long x;         cin >> x;         x %= 3;         if (x == 0) ans++;         if (x == 1) one++;         if (x == 2) two++;       }       if (one >= two) {         ans += two;         ans += (one - two) / 3;       } else {         ans += one;         ans += (two - one) / 3;       }       cout << ans <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, cnt11 = 0, cnt12 = 0, cnt13 = 0, cnt14 = 0, cnt15 = 0, cnt16 = 0,               cnt17 = 0, cnt18 = 0, cnt19 = 0;     int cnt21 = 0, cnt22 = 0, cnt23 = 0, cnt24 = 0, cnt25 = 0, cnt26 = 0,         cnt27 = 0, cnt28 = 0, cnt29 = 0;     cin >> n >> m;     int a[n], b[m];     for (int i = 0; i < n; i++) {       cin >> a[i];     }     for (int i = 0; i < m; i++) {       cin >> b[i];     }     sort(a, a + n);     sort(b, b + m);     for (int i = 0; i < n; i++) {       if (a[i] == 1) {         cnt11++;       }       if (a[i] == 2) {         cnt12++;       }       if (a[i] == 3) {         cnt13++;       }       if (a[i] == 4) {         cnt14++;       }       if (a[i] == 5) {         cnt15++;       }       if (a[i] == 6) {         cnt16++;       }       if (a[i] == 7) {         cnt17++;       }       if (a[i] == 8) {         cnt18++;       }       if (a[i] == 9) {         cnt19++;       }     }     for (int i = 0; i < m; i++) {       if (b[i] == 1) {         cnt21++;       }       if (b[i] == 2) {         cnt22++;       }       if (b[i] == 3) {         cnt23++;       }       if (b[i] == 4) {         cnt24++;       }       if (b[i] == 5) {         cnt25++;       }       if (b[i] == 6) {         cnt26++;       }       if (b[i] == 7) {         cnt27++;       }       if (b[i] == 8) {         cnt28++;       }       if (b[i] == 9) {         cnt29++;       }     }     if (cnt11 > 0 && cnt21 > 0) {       cout <<  1  << endl;     } else if (cnt12 > 0 && cnt22 > 0) {       cout <<  2  << endl;     } else if (cnt13 > 0 && cnt23 > 0) {       cout <<  3  << endl;     } else if (cnt14 > 0 && cnt24 > 0) {       cout <<  4  << endl;     } else if (cnt15 > 0 && cnt25 > 0) {       cout <<  5  << endl;     } else if (cnt16 > 0 && cnt26 > 0) {       cout <<  6  << endl;     } else if (cnt17 > 0 && cnt27 > 0) {       cout <<  7  << endl;     } else if (cnt18 > 0 && cnt28 > 0) {       cout <<  8  << endl;     } else if (cnt19 > 0 && cnt29 > 0) {       cout <<  9  << endl;     } else {       if (a[0] == b[0]) {         cout << a[0] << endl;       }       if (a[0] > b[0]) {         cout << b[0] << a[0] << endl;       }       if (a[0] < b[0]) {         cout << a[0] << b[0] << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 5;   const int mx = (1 << 30) - 1;   int n, m;   struct node {     vector<pair<int, int> > p;     void cal(int a, int b) {       int res = a ^ b;       for (int i = 0; i < 30; i++) {         int t = res ^ (1 << i) ^ (res & ((1 << i) - 1));         if ((t ^ a) > b) p.emplace_back(t, t + (1 << i) - 1);       }     }     void get(int first, int l, int r) {       cal(first, r);       cal(mx ^ first, mx ^ l);     }   };   void solve() {     node temp;     scanf( %d%d , &n, &m);     temp.get(n, 0, m);     sort(temp.p.begin(), temp.p.end());     printf( %d n , temp.p[0].first);   }   int main() {     int t;     scanf( %d , &t);     while (t--) solve();   }
#include <bits/stdc++.h>   using namespace std;   const int maxn = 5e5 + 10;   inline long long rd() {     long long x = 0;     char c = getchar();     int neg = 1;     while (c <  0  || c >  9 ) {       if (c ==  - ) neg = -1;       c = getchar();     }     while (c >=  0  && c <=  9 ) x = x * 10 + c -  0 , c = getchar();     return x * neg;   }   int N, Q, pre[maxn], A[maxn], tmp[maxn], ans[maxn];   pair<int, int> mn[maxn << 2];   struct Node {     int l, r, i;   } que[maxn];   inline bool cmp(Node a, Node b) { return a.r < b.r; };   inline void update(int p) { mn[p] = min(mn[p << 1], mn[p << 1 | 1]); }   void change(int p, int l, int r, int x, int y) {     if (l == r)       mn[p] = make_pair(y, x);     else {       int m = l + r >> 1;       if (x <= m)         change(p << 1, l, m, x, y);       else         change(p << 1 | 1, m + 1, r, x, y);       update(p);     }   }   pair<int, int> query(int p, int l, int r, int x, int y) {     if (x <= l && r <= y) return mn[p];     int m = l + r >> 1;     pair<int, int> re = make_pair(N + 1, 0);     if (x <= m) re = query(p << 1, l, m, x, y);     if (y >= m + 1) re = min(re, query(p << 1 | 1, m + 1, r, x, y));     return re;   }   int main() {     int i, j, k;     N = rd();     for (i = 1; i <= N; i++) {       A[i] = rd();       pre[i] = tmp[A[i]], tmp[A[i]] = i;     }     Q = rd();     for (i = 1; i <= Q; i++) {       que[i].l = rd(), que[i].r = rd(), que[i].i = i;     }     sort(que + 1, que + Q + 1, cmp);     memset(mn, 127, sizeof(mn));     for (i = 1, j = 1; i <= Q; i++) {       for (; j <= que[i].r && j <= N; j++) {         if (pre[j]) change(1, 1, N, pre[j], N + 1);         change(1, 1, N, j, pre[j]);       }       pair<int, int> re = query(1, 1, N, que[i].l, que[i].r);       if (re.first < que[i].l) ans[que[i].i] = A[re.second];     }     for (i = 1; i <= Q; i++) printf( %d n , ans[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   double f[100];   int k[100];   double cpw[100];   int N;   double calc(int i) { return (1 - cpw[i] * f[i]) / (1 - cpw[i]); }   int main() {     cin >> N;     int c;     int highInc = 0;     double P = 1;     for (int i = 0; i < N; i++) {       cin >> c;       cpw[i] = f[i] = 1.0 - (c / 100.0);       k[i] = 1;       if (calc(i) > calc(highInc)) highInc = i;       P *= (1 - f[i]);     }     double expval = 0;     double oldP;     for (int i = 1; i <= 300000; i++) {       oldP = P;       P *= calc(highInc);       k[highInc]++;       cpw[highInc] *= f[highInc];       expval += i * (P - oldP);       for (int j = 0; j < N; j++)         if (calc(j) > calc(highInc)) highInc = j;     }     cout << fixed << setprecision(20) << expval + N <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   const int oo = 0x3f3f3f3f;   const int SIZE = 4000050;   const int P = 67;   const int maxn = 20;   int a[maxn], b[maxn];   int F[260];   char str[10];   struct HASH {     int head[SIZE], next[SIZE];     unsigned long long state[SIZE];     double dp[SIZE];     int tol;     void init() {       memset(head, -1, sizeof head);       tol = 0;     }     double find(unsigned long long s) {       for (int i = head[s % SIZE]; i != -1; i = next[i]) {         if (state[i] == s) return dp[i];       }       return -1;     }     bool ins(unsigned long long s, double f) {       if (find(s) > -1) return false;       dp[++tol] = f;       state[tol] = s;       next[tol] = head[s % SIZE];       head[s % SIZE] = tol;       return true;     }   } mat;   unsigned long long Hash(int n) {     for (int i = 1; i <= n; i++) b[i] = a[i];     sort(b + 1, b + n);     unsigned long long s = 0;     for (int i = 1; i <= n; i++) {       s *= P;       s += b[i];     }     return s;   }   inline void set_ST(int st[], int x) {     st[0] = (x >> 4) & 3;     st[1] = (x >> 2) & 3;     st[2] = x & 3;   }   inline int get_ST(int a, int b, int c) {     if (a > c) swap(a, c);     return (((a << 2) + b) << 2) + c;   }   double dfs(int n) {     unsigned long long s = Hash(n);     double f = mat.find(s), c[4] = {0, 1e9, 1e9, 1e9};     if (f > -1) return f;     for (int i = 1; i < n; i++) {       int x[3], y[3], nn = n;       int ai = a[i], an = a[n];       set_ST(x, ai);       set_ST(y, an);       if ((!!x[0]) + (!!x[1]) + (!!x[2]) == 1) continue;       if (y[0] && y[1] && y[2]) {         nn++;         y[0] = y[1] = y[2] = 0;       }       for (int j = 0; j < 3; j++)         if (x[j]) {           if ((!!x[0]) + (!!x[1]) + (!!x[2]) == 2 && (j == 1 || !x[1])) continue;           int t = x[j];           x[j] = 0;           a[i] = get_ST(x[0], x[1], x[2]);           if ((!!x[0]) + (!!x[1]) + (!!x[2]) == 1 || !x[1]) a[i] = 0;           x[j] = t;           for (int k = 0; k < 3; k++)             if (!y[k]) {               y[k] = t;               a[nn] = get_ST(y[0], y[1], y[2]);               y[k] = 0;               c[t] = min(c[t], dfs(nn));             }         }       a[i] = ai;       a[n] = an;     }     if (c[1] == 1e9 && c[2] == 1e9 && c[3] == 1e9) {       mat.ins(s, 0);       return 0.0;     }     double p = 1.0 / 6.0;     if (c[1] == 1e9) p += 1.0 / 3.0, c[1] = 0;     if (c[2] == 1e9) p += 1.0 / 3.0, c[2] = 0;     if (c[3] == 1e9) p += 1.0 / 6.0, c[3] = 0;     f = (c[1] / 3.0 + c[2] / 3.0 + c[3] / 6.0 + 1.0) / (1.0 - p);     mat.ins(s, f);     return f;   }   int main() {     int n;     F[ G ] = 1;     F[ B ] = 2;     F[ R ] = 3;     mat.init();     while (scanf( %d , &n) != EOF) {       for (int i = 1; i <= n; i++) {         scanf( %s , str);         a[i] = get_ST(F[str[0]], F[str[1]], F[str[2]]);       }       printf( %.15lf n , dfs(n));     }   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     int n;     cin >> n;     vector<int> a(101);     for (int i = 0; i < n; i++) {       int x;       cin >> x;       ++a[x];     }     cout << *max_element(a.begin(), a.end()) << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k;   vector<int> v;   void solve() {     if (k == 1) {       for (int i = 0; 1 + i * (n - 1) <= n + m; i++) v.push_back(1 + i * (n - 1));       return;     }     for (int i = 1; i <= k; i++) v.push_back(1);     v.push_back(n);     for (int i = 1; i < k; i++) v.push_back(n + 1);     if (n == m) v.push_back(2 * n);   }   int main() {     scanf( %d %d %d , &n, &m, &k);     solve();     printf( %d n , v.size());     for (int i = 0; i < v.size(); i++)       printf( %d%c , v[i], i < v.size() - 1 ?     :   n );     return 0;   }
#include <bits/stdc++.h>   using namespace std;   using ll = long long;   using pii = pair<int, int>;   void solve() {     int n, b, d;     cin >> n >> b >> d;     int res = 0;     int currMass = 0;     for (int i = 0; i < n; i++) {       int got;       cin >> got;       if (got > b) continue;       currMass += got;       if (currMass > d) {         currMass = 0;         res++;       }     }     cout << res;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   long long int dp[2005][2005];   int main() {     int n, i, k1, j, k;     cin >> n >> k1;     long long int ans = 0;     dp[0][1] = 1;     for (i = 1; i <= k1; i++) {       for (j = 1; j <= n; j++) {         for (k = j; k <= n; k += j) {           dp[i][k] += dp[i - 1][j];           dp[i][k] %= 1000000007;         }       }     }     for (j = 1; j <= n; j++) {       ans += dp[k1][j];       ans %= 1000000007;     }     cout << ans << endl;   }