func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, h[100005], num = 0, lt = 0, rt, dp[100005], dp1[100005], cur;   int main() {     cin >> n;     for (int i = 1; i <= n; i++) cin >> h[i];     for (long long i = 1; i <= n; i++) {       long long temp = dp[lt] + (i - lt);       if (h[i] - cur <= 0 || temp <= cur) {         dp[i] = min(h[i], temp);         lt = i;         continue;       } else {         dp[i] = cur + 1;         cur++;       }     }     cur = 0;     lt = n + 1;     for (long long i = n; i >= 1; i--) {       long long temp = dp1[lt] + (lt - i);       if (h[i] - cur <= 0 || temp <= cur) {         dp1[i] = min(h[i], temp);         lt = i;         continue;       } else {         dp1[i] = cur + 1;         cur++;       }     }     long long ans = 0;     for (int i = 1; i <= n; i++) {       dp[i] = min(dp[i], dp1[i]);       ans = max(ans, dp[i]);     }     cout << ans;   }   