func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2501;   int dp[N][3], a[N << 1];   int main() {     int n;     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     memset(dp, 0x3f, sizeof(dp));     dp[0][0] = dp[1][1] = 0;     for (int i = 2; i <= n; i++)       for (int j = i + 1 >> 1; j; j--) {         dp[j][0] = min(dp[j][0], dp[j][2]);         dp[j][2] = dp[j][1] + max(0, a[i] - a[i - 1] + 1);         dp[j][1] =             min(dp[j - 1][0] + max(0, a[i - 1] - a[i] + 1),                 dp[j - 1][2] + max(0, min(a[i - 1], a[i - 2] - 1) - a[i] + 1));       }     for (int j = 1; j <= n + 1 >> 1; j++)       cout << min(dp[j][0], min(dp[j][1], dp[j][2])) <<    ;   }   