func_code_string: #include <bits/stdc++.h>   const double PI = 2.0 * acos(0.0);   const double EPS = 1e-9;   using namespace std;   int dr[] = {-1, 0, 1, 0, 1, 1, -1, -1};   int dc[] = {0, 1, 0, -1, -1, 1, -1, 1};   int V, E;   int T;   int N, M, K;   string S;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     cin >> N >> K;     int ans[5010];     int i, j;     map<int, vector<int>> m;     for (i = 0; i <= N - 1; i++) cin >> j, m[j].push_back(i);     int col = 0;     for (auto x : m) {       if (x.second.size() > K) {         cout <<  NO  << endl;         return 0;       } else {         for (j = 0; j <= x.second.size() - 1; j++) {           ans[x.second[j]] = col % K + 1;           col++;         }       }     }     cout <<  YES  << endl;     for (i = 0; i <= N - 1; i++) cout << ans[i] <<    ;     cout << endl;     return 0;   }   