func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long INF = 1 << 30;   typedef struct {     long long x, y;   } point;   priority_queue<pair<int, int>, vector<pair<int, int> >,                  greater<pair<int, int> > >       pq;   vector<pair<pair<int, int>, int> > vpp;   vector<pair<int, int> > vp;   const int N = 1e5 + 5;   const int seg = sqrt(N) + 1;   int main() {     int n, k;     cin >> n >> k;     vector<pair<int, int> > a(n);     vector<int> vi(n, 10);     for (int i = 0; i < n; i++) {       cin >> a[i].first;       a[i].second = i;     }     sort(a.rbegin(), a.rend());     queue<int> q;     for (int i = 0; i < n; i++) {       q.push(a[i].second);     }     set<int> idx;     for (int i = 0; i < n; ++i) {       idx.insert(i);     }     string ans(n,  c );     int who = 0;     while (!idx.empty()) {       while (!idx.count(q.front())) {         q.pop();       }       int pos = q.front();       q.pop();       vector<int> add;       auto it = idx.find(pos);       for (int i = 0; i <= k; i++) {         add.push_back(*it);         if (it == idx.begin()) break;         it--;       }       it = next(idx.find(pos));       for (int i = 0; i < k; i++) {         if (it == idx.end()) break;         add.push_back(*it);         it++;       }       for (auto it : add) {         idx.erase(it);         ans[it] =  1  + who;       }       who ^= 1;     }     cout << ans << endl;     return 0;   }   