func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     int n, k;     cin >> n >> k;     vector<pair<int, int>> a(n);     for (int i = 0; i < n; ++i) {       cin >> a[i].first;       a[i].second = i;     }     sort(a.rbegin(), a.rend());     queue<int> x;     for (int i = 0; i < n; ++i) {       x.push(a[i].second);     }     set<int> s;     for (int i = 0; i < n; ++i) s.insert(i);     int r = 0;     vector<int> ans(n, -1);     int t[2 * k + 1];     int ind = 0;     while (!s.empty()) {       while (s.count(x.front()) == 0) x.pop();       ind = 0;       t[ind] = x.front();       ind++;       auto it = s.find(x.front());       if (it != s.begin()) {         it--;         for (int i = 0; i < k; ++i) {           t[ind] = *it;           ind++;           if (it == s.begin()) break;           it--;         }       }       it = s.find(x.front());       if (it != s.end()) {         it++;         for (int i = 0; i < k; ++i) {           if (it == s.end()) break;           t[ind] = *it;           ind++;           it++;         }       }       for (int i = 0; i < ind; ++i) {         s.erase(t[i]);         ans[t[i]] = r;       }       r ^= 1;     }     for (int i : ans) cout << i + 1;     cout << endl;     return 0;   }   