func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 100100;   long long int a[N], l[N];   int main() {     int n;     long long int ans(0);     scanf( %d , &n);     for (int i = 1; i <= n; ++i) scanf( %lld , &a[i]), a[i]++;     long long int o(a[n] + 1);     for (int i = n; i >= 1; --i) l[i] = o = max(--o, a[i]);     for (int i = 1; i <= n; ++i) l[i] = max(l[i], l[i - 1]);     for (int i = 1; i <= n; ++i) ans += (l[i] - a[i]);     printf( %lld , ans);     return 0;   }   