func_code_string: #include <bits/stdc++.h>   using namespace std;   bool cmpDouble(const double& a, const double& b) {     return std::fabs(a - b) < std::numeric_limits<double>::epsilon();   }   int main() {     int n, k;     cin >> n >> k;     int arr[5001];     int ans[5001];     for (int i = 0; i < n; ++i) {       cin >> arr[i];       ans[i] = 0;     }     map<int, set<int>> seen;     for (int i = 0; i < k; ++i) {       ans[i] = i + 1;       seen[arr[i]].insert(i + 1);     }     for (int i = k; i < n; ++i) {       if (seen[arr[i]].size() >= k) {         cout <<  NO  << endl;         return 0;       }       for (int j = 1; j <= k; ++j) {         if (seen[arr[i]].find(j) == seen[arr[i]].end()) {           ans[i] = j;           seen[arr[i]].insert(j);           break;         }       }     }     cout <<  YES  << endl;     for (int i = 0; i < n; ++i) {       cout << ans[i] <<    ;     }     cout << endl;   }   