func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long maxn = 300000 + 10;   long long n;   long long ans[maxn], tot, vis[maxn], last;   int main() {     while (scanf( %lld , &n) != EOF) {       memset(vis, 0, sizeof(vis));       memset(ans, 0, sizeof(ans));       for (int i = 0; i < n; i++) scanf( %lld , &ans[i]);       last = n;       tot = 0;       printf( 1 );       for (int i = 0; i < n; i++) {         vis[ans[i]] = 1;         tot++;         while (vis[last] > 0) {           tot--;           last--;         }         printf(  %lld , tot + 1);       }       printf(  n );     }     return 0;   }   