func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int p;   int a[300010];   int ans;   int main() {     int i, j, k;     scanf( %d , &n);     ans = 1;     a[n + 1] = -1;     printf( 1 );     for (k = 1; k <= n; ++k) {       scanf( %d , &p);       if (a[p + 1] == -1) {         i = p - 1;         a[p] = -1;         while ((i > 0) && (a[i] == 1)) {           a[i] = -1;           --ans;           --i;         }       } else {         if (!a[p]) {           a[p] = 1;           ++ans;         }       }       printf(  %d , ans);     }   }   