func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long N = 2e5;   long long n, m, k, a[N], c, res;   struct stru {     long long col, x, l, r;   };   vector<stru> v;   vector<vector<long long>> mp(N), pr(N);   signed main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cin >> n >> m >> k;     for (long long i = 0; i < n; ++i) cin >> a[i];     for (long long i = 0; i < n - 1; ++i) {       if (a[i] == a[i + 1])         c++;       else {         v.push_back({a[i], c + 1, i - c, i});         c = 0;       }     }     v.push_back({a[n - 1], c + 1, n - 1 - c, n - 1});     for (long long i = 0; i < v.size(); ++i) {       long long col = v[i].col, l = 0, r = mp[col].size(), med, ni = v[i].l;       r--;       c = v[i].x;       while (r - l > 1) {         med = (r + l) / 2;         if (ni - mp[col][med] - 1 - pr[col].back() + pr[col][med] <= k)           r = med;         else           l = med;       }       if (!mp[col].empty() &&           ni - mp[col][l] - 1 - pr[col].back() + pr[col][l] <= k)         res = max(res, pr[col].back() - (l ? pr[col][l - 1] : 0) + c);       else if (!mp[col].empty() &&                ni - mp[col][r] - 1 - pr[col].back() + pr[col][r] <= k)         res = max(res, pr[col].back() - (r ? pr[col][r - 1] : 0) + c);       else         res = max(res, c);       mp[col].push_back(v[i].r);       if (!pr[col].empty())         pr[col].push_back(pr[col].back() + c);       else         pr[col].push_back(c);     }     cout << res;   }   