func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 5e5 + 7;   const int M = 60;   const int inf = 1e9 + 7;   const long long base = 1e18;   const double pi = acos(-1);   const double ep = 1e-18;   int n;   int a[N];   void solve() {     cin >> n;     for (int i = 0; i < n; i++) scanf( %d , a + i);     int last = 0;     while (last + 1 < n && a[last + 1] == a[0]) last++;     int i = last + 1;     int ans = 0;     while (i < n) {       int j = i;       while (j < n && a[j] == a[i]) j++;       if (i != n - 1 && j - i == 1) {         i = j;         continue;       } else {         ans = max(ans, (i - last) / 2);         for (int u = last + 1, v = i - 1; u <= v; u++, v--) {           a[u] = a[last];           a[v] = a[i];         }         i = j;         last = i - 1;       }     }     cout << ans << endl;     for (int i = 0; i < n; i++) printf( %d  , a[i]);   }   int main() { solve(); }   