func_code_string: #include <bits/stdc++.h>   const int maxn = 100005;   int n, m, a[maxn], pos[maxn];   std::pair<int, int> b[maxn];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf( %d , &a[i]);       b[i] = std::make_pair(a[i], i);     }     std::sort(b + 1, b + n + 1);     for (int i = 1; i <= n; ++i) pos[b[i].second] = i;     int ans = 0, r = 0;     for (int i = 1; i <= n; ++i) {       if (i > r) ans++;       r = std::max(r, pos[i]);     }     printf( %d n , ans);   }   