func_code_string: #include <bits/stdc++.h>   using namespace std;   int v[200005];   bool inQ[200005];   vector<pair<int, int> > foo;   int main() {     int n, k, q, p, m, i, j;     bool ok;     pair<int, int> x;     cin >> n >> k >> m;     for (i = 1; i <= n; ++i) cin >> v[i];     priority_queue<pair<int, int> > pq;     for (j = 0; j < m; ++j) {       cin >> q >> p;       if (q == 1) {         if (!inQ[p]) {           pq.push({v[p], p});           inQ[p] = 1;         }       } else {         if (!inQ[p])           ok = 0;         else {           ok = i = 0;           while (!pq.empty() && i < k) {             x = pq.top();             pq.pop();             foo.push_back(x);             if (x.second == p) {               ok = true;               break;             }             ++i;           }           while (!foo.empty()) {             pq.push(foo.back());             foo.pop_back();           }         }         if (ok == true)           cout <<  YES n ;         else           cout <<  NO n ;       }     }     return 0;   }   