func_code_string: #include <bits/stdc++.h>   using namespace std;   int ans1[300003], ans2[300003], l[300003];   vector<int> t[2400024];   vector<int> a, q;   void build(int v, int tl, int tr) {     if (tl == tr) {       t[v].push_back(a[tl]);       return;     }     int mid = (tl + tr) / 2;     build(v * 2, tl, mid);     build(v * 2 + 1, mid + 1, tr);     int l = 0, r = 0;     t[v].reserve(t[v * 2].size() + t[v * 2 + 1].size());     while (l != t[v * 2].size() || r != t[v * 2 + 1].size()) {       if (l == t[v * 2].size()) {         t[v].push_back(t[v * 2 + 1][r++]);       } else if (r == t[v * 2 + 1].size()) {         t[v].push_back(t[v * 2][l++]);       } else if (t[v * 2][l] < t[v * 2 + 1][r]) {         t[v].push_back(t[v * 2][l++]);       } else {         t[v].push_back(t[v * 2 + 1][r++]);       }     }   }   int ask(int v, int tl, int tr, int l, int r, int x) {     if (l > r) {       return 0;     }     if (tl == l && tr == r) {       l = -1;       r = t[v].size();       while (r - l > 1) {         int mid = (r + l) / 2;         if (t[v][mid] < x) {           l = mid;         } else {           r = mid;         }       }       return r;     }     int mid = (tl + tr) / 2;     return ask(v * 2, tl, mid, l, min(r, mid), x) +            ask(v * 2 + 1, mid + 1, tr, max(l, mid + 1), r, x);   }   int main() {     int n, m;     cin >> n >> m;     a.push_back(1e9 + 7);     for (int i = n; i > 0; --i) {       ans1[i] = i;       l[i] = a.size();       a.push_back(0);     }     while (m--) {       int x;       cin >> x;       ans1[x] = 1;       q.push_back(x);       a.push_back(l[x]);       l[x] = a.size() - 1;     }     build(1, 0, a.size() - 1);     for (int i = n + 1; i < a.size(); ++i) {       ans2[q[i - n - 1]] =           max(ans2[q[i - n - 1]], ask(1, 0, a.size() - 1, a[i], i, a[i]));     }     for (int i = 1; i <= n; ++i) {       ans2[i] = max(ans2[i], ask(1, 0, a.size() - 1, l[i], a.size() - 1, l[i]));       cout << ans1[i] <<     << ans2[i] << endl;     }   }   