malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   bool cmp(string s1, string s2) { return (s1 + s2) < (s2 + s1); }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,         v, w, x, y, z;     cin >> n;     vector<string> v1;     string s1;     for (i = 0; i < n; i++) {       cin >> s1;       v1.push_back(s1);     }     sort(v1.begin(), v1.end(), cmp);     for (i = 0; i < n; i++) cout << v1[i];     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long a, b, c, d, e, i, j, has = 0;     cin >> a >> b;     has += (a / 5) * (b / 5);     c = a / 5;     d = b / 5;     if (a % 5 >= 1) c++;     if (b % 5 >= 4) d++;     has += (c * d);     c = a / 5;     d = b / 5;     if (a % 5 >= 2) c++;     if (b % 5 >= 3) d++;     has += (c * d);     c = a / 5;     d = b / 5;     if (a % 5 >= 3) c++;     if (b % 5 >= 2) d++;     has += (c * d);     c = a / 5;     d = b / 5;     if (a % 5 >= 4) c++;     if (b % 5 >= 1) d++;     has += (c * d);     cout << has <<   n ;   }
#include <bits/stdc++.h>   #pragma GCC optimize( Ofast,no-stack-protector,unroll-loops,fast-math )   using namespace std;   const int N = 3e5 + 100;   set<pair<int, int> > s[N];   int a[N];   int nxt[N];   int dp[N];   int mol[N];   int n;   void add(long long int v, long long int u) {     long long int m = mol[u];     if (m != n + 2) s[m].insert({a[v], v});     mol[v] = mol[u];   }   int tt;   void Main(long long int oo) {     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];       nxt[i] = n + 2;       s[i].clear();       dp[i] = 0;     }     s[n + 1].clear();     s[n + 2].clear();     a[n + 1] = -1;     a[n + 2] = -1;     dp[n + 2] = 0;     dp[n + 1] = 0;     nxt[n + 2] = n + 2;     mol[n + 2] = n + 2;     nxt[n + 1] = n + 1;     for (int i = 1; i <= n + 1; i++) {       mol[i] = n + 1;     }     vector<int> pashm;     for (int i = n; i; i--) {       if (a[i] == a[i + 1]) {         nxt[i] = i + 2;         add(i, i + 2);       } else {         long long int z = mol[nxt[i + 1]];         if (z == n + 3) z = n + 2;         auto y = s[z].lower_bound({a[i], 0});         if (y != s[z].end() && y->first == a[i]) {           long long int p = y->second;           nxt[i] = p + 1;           add(i, p + 1);         } else {           mol[i] = i;           nxt[i] = n + 2;           add(i, i);         }       }     }     long long int ans = 0;     for (int i = n; i; i--) {       if (nxt[i] != n + 2) {         dp[i] = 1 + dp[nxt[i]];       }       ans += dp[i];     }     cout << ans <<   n ;   }   int32_t main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> tt;     for (int i = 1; i <= tt; i++) Main(i);   }
#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 << endl; }   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;   }   const int M = 1024 * 256;   int n, k, x;   int in[M];   int main() {     scanf( %d%d , &n, &k);     for (int i = (2); i <= (int)(n); ++i) {       int a, b;       scanf( %d%d , &a, &b);       in[a]++;       in[b]++;     }     for (int i = (1); i <= (int)(n); ++i) {       if (in[i] == 1) {         x++;       }     }     printf( %.9Lf n , (long double)(k * 2) / x);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long inf = 1e9 + 5;   const long long INF = 1e18 + 5;   const long long maxn = 5e5 + 5;   long long n = 1000000007, d[151111], mx = -1000000001;   long long a[1511111], ok[100005], sum, cnt, rg[555555], v[555555];   long long bi(long long x, long long y) {     if (y == 0) return 1ll;     if (y == 1) return x;     long long z = bi(x, y / 2);     z = z * z % n;     if (y & 1) z = z * x % n;     return z % n;   }   bool ch(string a, string b) { return a > b; }   map<string, long long> mm;   map<pair<string, string>, long long> ma;   long long first(long long m) {     long long ans = m;     for (long long i = 2; i * i <= m; i++) {       if (m % i == 0) {         while (m % i == 0) m /= i;         ans -= ans / i;       }     }     if (m > 1) ans -= ans / m;     return ans;   }   long long dp[555555][55], b[55][55];   int main() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(NULL);     long long m;     cin >> m;     while (m--) {       long long l, r, x;       cin >> l >> r;       x = l;       for (long long i = 0; i <= 60; i++) {         if ((x | (1ll << i)) <= r) {           x |= (1ll << i);         }       }       cout << x << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   #pragma comment(linker,  /STACK:102400000,102400000 )   const int N = 2000005;   long long n, A, B, x, y;   int p[N];   int main() {     scanf( %lld%lld%lld , &n, &A, &B);     y = -1;     for (; x * A <= n; ++x) {       long long tmp = n - x * A;       if (tmp / B * B == tmp) {         y = tmp / B;         break;       }     }     if (y == -1) return 0 * printf( -1 n );     int i = 1;     while (x--) {       int ti = i;       p[ti + A - 1] = i;       for (int ci = 1; ci <= A; ++ci) {         if (ci < A) p[i] = i + 1;         ++i;       }     }     while (y--) {       int ti = i;       p[ti + B - 1] = i;       for (int ci = 1; ci <= B; ++ci) {         if (ci < B) p[i] = i + 1;         ++i;       }     }     for (int i = 1; i <= n; ++i) printf( %d  , p[i]);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   template <class c>   struct rge {     c b, e;   };   template <class c>   rge<c> range(c i, c j) {     return rge<c>{i, j};   }   template <class c>   auto dud(c* x) -> decltype(cerr << *x, 0);   template <class c>   char dud(...);   struct debug {     template <class c>     debug& operator<<(const c&) {       return *this;     }   };   void test_case() {     int n;     scanf( %d , &n);     vector<int> a(n);     const int INF = 1e9 + 5;     long long L = 1, R = INF;     set<long long> s;     long long offset = 0;     int dp = 0;     for (int i = 0; i < n; ++i) {       scanf( %d , &a[i]);       if (i % 2 == 1) {         int diff = a[i] - a[i - 1];         L += diff;         R += diff;         offset += diff;       }       L = max(L, 1LL);       R = min(R, a[i] - 1LL);       while (!s.empty() && *s.begin() + offset < 1) {         s.erase(s.begin());       }       while (!s.empty() && *s.rbegin() + offset >= a[i]) {         s.erase(prev(s.end()));       }       if (L <= R || !s.empty()) {         if (i != 0) {           dp++;         }         if (a[i] % 2 == 0) {           if ((L <= a[i] / 2 && a[i] / 2 <= R) || s.count(a[i] / 2 - offset)) {             dp++;             L = R = a[i] / 2;             s.clear();           } else {             s.insert(a[i] / 2 - offset);           }         }       } else {         L = 1;         R = a[i] - 1;         if (a[i] % 2 == 0) {           L = R = a[i] / 2;           dp++;         }       }     }     debug() <<   [              <<  dp                  :               << (dp) <<  ]  ;     printf( %d n , 2 * n - dp);   }   int main() {     int T;     scanf( %d , &T);     while (T--) {       test_case();     }   }
#include <bits/stdc++.h>   using namespace std;   struct kmp {     vector<int> lps;     string pattern;     void compute_lps() {       int lptr = 0, rptr = 1;       lps[0] = 0;       while (rptr < lps.size()) {         while (lptr != 0 && pattern[lptr] != pattern[rptr]) lptr = lps[lptr - 1];         if (pattern[lptr] == pattern[rptr]) lptr++;         lps[rptr] = lptr;         rptr++;       }     }     kmp(string& s) {       pattern = s;       lps.resize(s.size());       compute_lps();     }     void search(string& s) {       vector<int> hits;       int lptr = 0, rptr = 0;       while (rptr < s.size()) {         while (lptr != 0 && pattern[lptr] != s[rptr]) lptr = lps[lptr - 1];         if (pattern[lptr] == s[rptr]) lptr++;         rptr++;         if (lptr == pattern.size()) {           hits.push_back(rptr - pattern.size());           lptr = lps[lptr - 1];         }       }     }   };   long long mod = 1e9 + 7;   long long add(long long a, long long b) { return (a + b) % mod; }   long long sub(long long a, long long b) { return ((a - b) % mod + mod) % mod; }   long long mul(long long a, long long b) { return (a * b) % mod; }   const int maxn = 205;   long long dp[maxn][maxn][maxn][2], ans;   int n;   string s;   int getmaxlen(kmp& KMP, char t, int mptr) {     if (mptr == s.size()) mptr = KMP.lps[mptr - 1];     while (s[mptr] != t && mptr != 0) mptr = KMP.lps[mptr - 1];     if (s[mptr] == t) mptr++;     return mptr;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     cin >> n >> s;     dp[0][0][0][0] = 1;     kmp KMP(s);     for (int i = 0; i < (2 * n); i++) {       for (int j = 0; j <= n; j++) {         for (int k = 0; k < (2 * n) && k <= s.size(); k++) {           for (int l = 0; l < 2; l++) {             if (dp[i][j][k][l] == 0) continue;             int mptr = getmaxlen(KMP,  ( , k);             int matched = l;             if (mptr == s.size()) matched = 1;             dp[i + 1][j + 1][mptr][matched] =                 add(dp[i + 1][j + 1][mptr][matched], dp[i][j][k][l]);             if (j != 0) {               mptr = getmaxlen(KMP,  ) , k);               matched = l;               if (mptr == s.size()) matched = 1;               dp[i + 1][j - 1][mptr][matched] =                   add(dp[i + 1][j - 1][mptr][matched], dp[i][j][k][l]);             }           }         }       }     }     for (int i = 0; i <= s.size(); i++) ans = add(ans, dp[2 * n][0][i][1]);     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e5 + 5;   const long double INF = 1e100;   const long double eps = 1e-12;   template <typename T>   void chkmax(T &x, T y) {     x = max(x, y);   }   template <typename T>   void chkmin(T &x, T y) {     x = min(x, y);   }   template <typename T>   void read(T &x) {     x = 0;     int f = 1;     char c = getchar();     for (; !isdigit(c); c = getchar())       if (c ==  - ) f = -f;     for (; isdigit(c); c = getchar()) x = x * 10 + c -  0 ;     x *= f;   }   template <typename T>   void write(T x) {     if (x < 0) x = -x, putchar( - );     if (x > 9) write(x / 10);     putchar(x % 10 +  0 );   }   template <typename T>   void writeln(T x) {     write(x);     puts(  );   }   int n, p, q;   long double a[MAXN], b[MAXN];   long double check(long double x) {     long double y = 1;     for (int i = 1; i <= n; i++) chkmin(y, (1.0 - x * a[i]) / b[i]);     return x * p + y * q;   }   int main() {     read(n), read(p), read(q);     long double l = 0, r = INF;     for (int i = 1; i <= n; i++) {       read(a[i]), read(b[i]);       chkmin(r, 1.0 / a[i]);     }     while (l + eps < r) {       long double ml = (2 * l + r) / 3, mr = (l + 2 * r) / 3;       if (check(ml) > check(mr))         r = mr;       else         l = ml;     }     printf( %.10Lf n , check((l + r) / 2));     return 0;   }
// In the name of Allah.   // We re nothing and you re everything.   // Ya Ali!      #include <bits/stdc++.h>      using namespace std;   typedef long long ll;   const int MAX_N = 1e5 + 14, MAX_K = 40;   int n, k;      struct XorKeeper {       int a[MAX_K]{};          XorKeeper operator^(const XorKeeper &o) {           XorKeeper ret;           for (int i = 0; i < 2 * k; ++i) {               ret.a[i] = a[i] ^ o.a[i];           }           return ret;       }          XorKeeper &operator^=(const XorKeeper &o) {           return *this = *this ^ o;       }          XorKeeper next() const {           XorKeeper ret = *this;           rotate(ret.a, ret.a + 2 * k - 1, ret.a + 2 * k);           return ret;       }          int get_ans() {           return accumulate(a + k, a + 2 * k, 0, [](int x, int y) { return x ^ y; });       }   } down[MAX_N], up[MAX_N];      vector<int> g[MAX_N];   int a[MAX_N];      void dfs_down(int v = 0, int p = -1) {       down[v].a[0] = a[v];       for (auto u : g[v])           if (u != p) {               dfs_down(u, v);               down[v] ^= down[u].next();           }   }      void dfs_up(int v = 0, int p = -1) {       for (auto u : g[v])           if (u != p) {               up[u] = (up[v] ^ down[v] ^ down[u].next()).next();               dfs_up(u, v);           }   }      int main() {       ios::sync_with_stdio(0), cin.tie(0);       cin >> n >> k;       for (int i = 0; i < n - 1; ++i) {           int v, u;           cin >> v >> u;           v--, u--;           g[v].push_back(u);           g[u].push_back(v);       }       for (int i = 0; i < n; ++i) {           cin >> a[i];       }       dfs_down();       dfs_up();       for (int i = 0; i < n; ++i) {           cout << bool(down[i].get_ans() ^ up[i].get_ans()) <<    ;       }       cout <<   n ;   }
#include <bits/stdc++.h>   using namespace std;   namespace hjt {   template <typename A, typename B>   std::ostream &operator<<(std::ostream &o, const std::pair<A, B> &x) {     return o <<  (  << x.first <<  ,  << x.second <<  ) ;   }   }  // namespace hjt   using namespace hjt;   const double eps = 1e-7;   const double PI = acos(-1);   const int MOD = 998244353;   const int INF = 0x3f3f3f3f;   const int N = 3e5 + 7;   int n;   int a[N], b[N], dp[N];   pair<int, int> path[N];   set<int> st;   vector<int> ans;   void update(int &x, int y) {     if (x == -1 || y < x) x = y;   }   inline void solve() {     cin >> n;     for (int i = 1; i <= n; ++i) cin >> a[i];     for (int i = 1; i <= n; ++i) cin >> b[i];     st.clear();     for (int i = 0; i <= n + 1; ++i) {       dp[i] = -1;       st.insert(i);     }     queue<int> q;     dp[n] = 0;     q.push(n);     while (q.size()) {       int u = q.front();       q.pop();       while (true) {         int x = *st.lower_bound(u - a[u]);         if (x > u) break;         st.erase(x);         int v = x + b[x];         if (dp[v] == -1 || dp[u] + 1 < dp[v]) {           dp[v] = dp[u] + 1;           path[v] = {u, x};           q.push(v);         }       }     }     if (dp[0] == -1) {       cout <<  -1 n ;       return;     }     ans.clear();     for (int i = 0; i != n; i = path[i].first) {       ans.emplace_back(path[i].second);     }     reverse(ans.begin(), ans.end());     cout << ans.size() <<   n ;     for (int &i : ans) cout << i <<    ;     cout <<   n ;   }   signed main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     cout.tie(nullptr);     int T = 1;     for (int t = 1; t <= T; ++t) {       solve();     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long n, i, s, f, h, co = 0, sum, savesum, res, re, savere;     cin >> n;     long long a[n + 1];     for (i = 1; i <= n; i++) {       cin >> a[i];     }     cin >> s >> f;     h = f - s;     queue<long long> qu;     i = 1;     sum = 0;     savesum = 0;     res = 1;     for (i = 1; i <= h; i++) {       qu.push(a[i]);       sum += a[i];       savesum = sum;     }     re = s;     savere = s;     for (i = h + 1; i <= n; i++) {       sum += a[i] - qu.front();       qu.pop();       qu.push(a[i]);       if (sum > savesum) {         res = i - h + 1;         savesum = sum;         re = s - res + 1;         if (re < 1) re += n;         savere = re;       } else if (sum == savesum) {         res = i - h + 1;         savesum = sum;         re = s - res + 1;         if (re < 1) re += n;         if (savere > re) savere = re;       }     }     for (i = 1; i <= h; i++) {       sum += a[i] - qu.front();       qu.pop();       qu.push(a[i]);       if (sum > savesum) {         savesum = sum;         res = n - h + 1 + i;         re = s - res + 1;         if (re < 1) re += n;         savere = re;       } else if (sum == savesum) {         res = n - h + 1 + i;         re = s - res + 1;         if (re < 1) re += n;         if (savere > re) savere = re;       }     }     cout << savere;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   vector<vector<int>> tr;   int n;   int mx_bits = 40;   int ind = 0;   long long xor_sum = 0;   long long ans;   vector<long long> v;   void insert_tr(long long num) {     int node = 0;     for (int i = (int)mx_bits; i >= (int)0; --i) {       bool bit = ((num >> i) & 1) > 0;       if (tr[node][bit] == -1) {         tr.push_back(vector<int>(2, -1));         ++ind;         tr[node][bit] = ind;       }       node = tr[node][bit];     }   }   long long query_tr(long long num) {     long long ret = 0;     int node = 0;     long long val = 1;     for (int i = (int)mx_bits; i >= (int)0; --i) {       bool bit = ((num >> i) & 1) > 0;       if (tr[node][1 - bit] != -1) {         ret += val << i;         node = tr[node][1 - bit];       } else         node = tr[node][bit];     }     return ret;   }   void solve() {     ans = xor_sum;     long long cur = 0;     insert_tr(cur);     for (int i = (int)0; i < (int)n; ++i) {       cur ^= v[i];       insert_tr(cur);       long long ret = query_tr(xor_sum ^ cur);       ans = max(ans, ret);     }     cout << ans;   }   int main() {     ios_base::sync_with_stdio(false);     tr.push_back(vector<int>(2, -1));     cin >> n;     v.resize(n);     for (int i = (int)0; i < (int)n; ++i) {       cin >> v[i];       xor_sum = xor_sum ^ v[i];     }     solve();     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 305;   int n;   int f[N][N], dp[2][N][N];   int main() {     std::ios::sync_with_stdio(false);     cin >> n;     for (int i = 0; i < n; ++i) {       for (int j = 0; j < n; ++j) {         cin >> f[i][j];       }     }     memset(dp, -1, sizeof(dp));     dp[0][0][0] = f[0][0];     for (int d = 1; d < 2 * n; ++d) {       for (int i = 0; i < n; ++i) {         for (int j = 0; j < n; ++j) {           int x1 = i, y1 = d - i;           int x2 = j, y2 = d - j;           if (y1 < 0 || y2 < 0 || y1 > n - 1 || y2 > n - 1) continue;           int add;           if (x1 == x2 && y1 == y2)             add = f[x1][y1];           else             add = f[x1][y1] + f[x2][y2];           int &res = dp[d % 2][x1][x2] = -1000 * 1000 * 1000;           if (x1 > 0 && x2 > 0)             res = max(res, dp[(d - 1) % 2][x1 - 1][x2 - 1] + add);           if (x1 > 0 && y2 > 0) res = max(res, dp[(d - 1) % 2][x1 - 1][x2] + add);           if (y1 > 0 && y2 > 0) res = max(res, dp[(d - 1) % 2][x1][x2] + add);           if (y1 > 0 && x2 > 0) res = max(res, dp[(d - 1) % 2][x1][x2 - 1] + add);         }       }     }     cout << dp[(2 * n - 2) % 2][n - 1][n - 1] << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     long long int t;     cin >> t;     while (t-- > 0) {       long long int n, k, can = 0;       cin >> n >> k;       can += n / k;       can = can * k;       if (can < n) {         if (n - can < k / 2)           can += n - can;         else           can += k / 2;       }       cout << can << endl;     }   }
#include <bits/stdc++.h>   using namespace std;   const int INF = 1000000000;   const int MAXN = 30005;   int lst[MAXN], N;   bool ok(vector<int> &v) {     if ((int)v.size() <= 2) return true;     for (int i = (int)v.size() - 2; i >= max(1, (int)v.size() - 5); i--)       if (v[i + 1] - v[i] != v[1] - v[0]) return false;     return true;   }   bool check(vector<int> &a, vector<int> &b, int n) {     if ((int)a.size() < 2) {       b.push_back(lst[n]);       if (!ok(b)) {         b.erase(b.end() - 1);         a.push_back(lst[n]);       }     } else if ((int)b.size() < 2) {       a.push_back(lst[n]);       if (!ok(a)) {         a.erase(a.end() - 1);         b.push_back(lst[n]);       }     } else {       a.push_back(lst[n]);       if (!ok(a)) {         a.erase(a.end() - 1);         b.push_back(lst[n]);       }     }     return ok(a) && ok(b);   }   int main() {     cin >> N;     for (int i = 0; i < N; i++) cin >> lst[i];     int sz = min(6, N);     vector<int> x, y;     for (int mask = 0; mask < (1 << sz); mask++) {       vector<int> a, b;       for (int i = 0; i < sz; i++) {         if (mask & (1 << i))           a.push_back(lst[i]);         else           b.push_back(lst[i]);       }       if (!ok(a) || !ok(b)) continue;       bool k = true;       for (int i = sz; i < N; i++) {         if (!check(a, b, i)) {           k = false;           break;         }       }       if (k) {         x = a, y = b;         break;       }     }     if ((int)x.size() == 0 && (int)y.size() > 0) {       x.push_back(y[(int)y.size() - 1]);       y.erase(y.end() - 1);     } else if ((int)y.size() == 0 && (int)x.size() > 0) {       y.push_back(x[(int)x.size() - 1]);       x.erase(x.end() - 1);     }     if ((int)x.size() == 0 && (int)y.size() == 0) {       cout <<  No solution  << endl;       return 0;     }     for (int i = 0; i < (int)x.size(); i++) cout << x[i] <<    ;     cout << endl;     for (int i = 0; i < (int)y.size(); i++) cout << y[i] <<    ;     cout << endl;   }
#include <bits/stdc++.h>   const int INF = 0x7fffffff;   const long long int LNF = 0x7fffffffffffffff;   using namespace std;   int ac[26], az[26];   char aa[105], bb[105];   int main() {     int i, k, nn, kk = 0, len1, len2, s;     scanf( %d , &nn);     getchar();     while (kk < nn) {       gets(aa);       gets(bb);       len1 = strlen(aa);       len2 = strlen(bb);       memset(az, 0, sizeof(az));       k = 0;       while (k < len1) {         az[aa[k] -  a ]++;         k++;       }       k = 0;       s = 1;       while (k + len1 <= len2) {         memset(ac, 0, sizeof(ac));         i = 0;         while (i < len1) {           ac[bb[k + i] -  a ]++;           i++;         }         i = 0;         s = 0;         while (i < 26) {           if (ac[i] != az[i]) {             s = 1;             break;           }           i++;         }         if (s == 0) {           break;         }         k++;       }       if (s == 0) {         printf( YES n );       } else {         printf( NO n );       }       kk++;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, t, c;     cin >> n >> t >> c;     int arr[n];     for (int i = 0; i < n; i++) {       cin >> arr[i];     }     int count = 0;     int ans = 0;     for (int i = 0; i < n; i++) {       if (arr[i] <= t) {         count++;         if (i == n - 1) {           ans += max(0, count - c + 1);         }       } else {         ans += max(0, count - c + 1);         count = 0;       }     }     cout << ans;     return 0;   }