func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 3e5 + 10;   int lim;   int n;   int p[maxn] = {0};   int res[maxn] = {0};   bool vis[maxn] = {0};   int cnt = 0;   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %d , &p[i]);     }     lim = n;     res[cnt++] = 1;     for (int i = 1; i <= n; ++i) {       int temp = i + 1 + lim - n;       vis[p[i]] = 1;       if (p[i] == lim) {         temp--;         lim--;         for (int j = p[i] - 1;; --j) {           if (vis[j]) {             temp--;             lim--;           } else             break;         }       }       res[cnt++] = temp;     }     for (int i = 0; i <= n; ++i) {       cout << res[i] <<    ;     }     cout << endl;     return 0;   }   