func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( Ofast )   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimization( unroll-loops )   const long double pi = 2 * acos(0.0);   using namespace std;   int power(int a, int n) {     if (n == 0) {       return 1;     }     int p = power(a, n / 2) % 1000000007;     p = (p * p) % 1000000007;     if (n % 2 == 1) {       p = (p * a) % 1000000007;     }     return p;   }   int gcd(int a, int b) {     if (a == 0) return b;     return gcd(b % a, a);   }   const int N = 1e6 + 5;   vector<int> sieve(N, 0);   void si() {     sieve[1] = 1;     for (int i = 2; i < N; i++) {       if (sieve[i] == 0) {         sieve[i] = i;         for (int j = 2 * i; j < N; j += i) {           sieve[j] = i;         }       }     }   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     ;     int n;     cin >> n;     if (n == 1) {       cout << 0 <<   n ;       return 0;     }     vector<int> a(n + 1);     ;     for (int i = 0; i < n; i++) cin >> a[i];     ;     a[n] = 0;     int k = (n + 1) / 2;     int dp[n + 1][k + 1][2];     for (int i = 0; i <= n; i++) {       for (int j = 0; j <= k; j++) {         dp[i][j][0] = 1e9;         dp[i][j][1] = 1e9;       }     }     dp[1][0][0] = 0;     dp[1][1][1] = a[1] - min(a[0] - 1, a[1]);     for (int i = 0; i <= n; i++) {       dp[i][0][0] = 0;     }     vector<int> ans(k, 1e9);     for (int i = 2; i <= n; i++) {       for (int j = 1; j <= k; j++) {         dp[i][j][0] = min(dp[i - 1][j][0], dp[i - 1][j][1]);         int z = 1e9;         if (i - 3 >= 0) {           z = dp[i - 2][j - 1][1];           if (a[i - 3] > a[i - 1]) {             z += a[i - 3] - a[i - 1];           }           z += a[i] - min(a[i], a[i - 1] - 1);         }         dp[i][j][1] = min(dp[i - 1][j - 1][0] + a[i] - min(a[i], a[i - 1] - 1) +                               a[i - 2] - min(a[i - 2], a[i - 1] - 1),                           z);         dp[i][j][1] = min(dp[i][j][1], (int)(1e9));         ans[j - 1] = min(ans[j - 1], dp[i][j][1]);         ans[j - 1] = min(ans[j - 1], dp[i][j][0]);       }     };     for (int i = 0; i < k; i++) cout << ans[i] <<    ;     ;     cout <<   n ;     return 0;   }   