-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCLONE.cpp
More file actions
36 lines (32 loc) · 749 Bytes
/
CLONE.cpp
File metadata and controls
36 lines (32 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* http://www.spoj.com/problems/CLONE/ */
#include<string>
#include<stdio.h>
#include<map>
#include<iostream>
#define MAX 20000
using namespace std;
int myVector[MAX];
int main(){
//freopen ("CLONE.in","r",stdin);
map<string,int> myMap;
map<string,int>::iterator it;
int n,m;
string DNA;
for(;;){
scanf("%d",&n);
scanf("%d",&m);
if(n==0 && m==0) break;
for(int j=0;j<n;j++){
cin>>DNA;
myMap[DNA]++;
}
for (it=myMap.begin(); it!=myMap.end(); ++it) myVector[it->second]++;
for (int j=1;j<=n;j++){
printf("%d\n",myVector[j]);
myVector[j]=0;
}
myMap.clear();
}
//fclose (stdin);
return 0;
}