Solution to the problem number CLONE of Spoj - CLONE.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
    int n, m, j;
    cin>>n>>m;
    while(n != 0 && m != 0){
        map<string, int> CLONES;
        string nda;
        j = n;
        int A[n];
        for (int i = 0; i < n; ++i){
            A[i] = 0;
        }
        while(n--){
            cin >> nda;
            CLONES[nda]++;
        }
        for (map<string, int>::iterator it=CLONES.begin(); it != CLONES.end(); it++) {
            ++A[it->second - 1];
        }
        for (int i = 0; i < j; ++i){
          cout<<A[i]<<endl;
        }
        cin>>n>>m;
    }
    return 0;
} 

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!