func_code_string: #include <bits/stdc++.h>   using namespace std;   const int Q = 86401;   int n, M, T;   int R, res[20000];   vector<int> in[Q];   vector<int> out[Q];   int outTime[20000];   int main() {     scanf( %d%d%d , &n, &M, &T);     int a, b, c;     for (int i = 0; i < n; ++i) {       scanf( %d:%d:%d , &a, &b, &c);       a = a * 60 * 60 + b * 60 + c;       in[a].push_back(i);       out[a + T - 1].push_back(i);     }     set<pair<int, int> > q;     bool maxF = false;     for (int i = 0; i < Q; ++i) {       maxF |= q.size() == M;       for (int j = 0; j < in[i].size(); ++j) {         int u = in[i][j];         if (q.size() < M) {           res[u] = ++R;         } else {           int v = (*--q.end()).second;           q.erase(--q.end());           res[u] = res[v];         }         outTime[u] = i + T - 1;         q.insert(make_pair(i + T - 1, u));       }       for (int j = 0; j < out[i].size(); ++j) {         int u = out[i][j];         q.erase(make_pair(outTime[u], u));       }     }     if (!maxF)       puts( No solution );     else {       map<int, int> mp;       R = 0;       for (int i = 0; i < n; ++i) {         if (mp.find(res[i]) == mp.end()) {           mp[res[i]] = ++R;         }         res[i] = mp[res[i]];       }       printf( %d n , R);       for (int i = 0; i < n; ++i) printf( %d n , res[i]);     }     return 0;   }   