func_code_string: #include <bits/stdc++.h>   using namespace std;   struct congressman {     int votes;     int last_vote;     int nr_of_order;     bool operator<(const congressman &other) const {       if (votes == other.votes) return last_vote > other.last_vote;       return votes < other.votes;     };   } v[105];   int n, k, m, a, pos[105];   bool elected(int i) {     int better = n - i;     int t = m - a;     for (int j = i - 1; j >= 1; j--)       if (t >= v[i].votes - v[j].votes + 1)         t -= v[i].votes - v[j].votes + 1, better++;       else         break;     return (better < k && v[i].votes != 0);   }   bool notelectible(int i) {     int last = i;     for (int j = i + 1; j <= n; j++)       if (v[i].votes + m - a > v[j].votes)         last = j;       else         break;     if (v[i].votes + m - a == 0) return 1;     return (last < n - k + 1);   }   int main() {     int i, j;     cin >> n >> k >> m >> a;     for (i = 1; i <= a; i++) {       cin >> j;       v[j].votes++;       v[j].last_vote = max(v[j].last_vote, i);     }     for (i = 1; i <= n; i++) v[i].nr_of_order = i;     sort(v + 1, v + n + 1);     for (i = 1; i <= n; i++) pos[v[i].nr_of_order] = i;     for (i = 1; i <= n; i++) {       int r = 0;       if (elected(pos[i]))         r = 1;       else if (notelectible(pos[i]))         r = 3;       else         r = 2;       cout << r <<    ;     }     return 0;   }   