fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main ()
  4. {
  5. ios::sync_with_stdio(false);
  6. while(1)
  7. {
  8. map <string,int> a;
  9. map <string,int>::iterator it;
  10. string b;
  11. int i,n,m,ma=0,f[20001]={};
  12. scanf("%d%d",&n,&m);
  13. if(n==0) break;
  14. for(i=0;i<n;i++)
  15. {
  16. cin>>b;
  17. a[b]++;
  18. }
  19. for(it=a.begin();it!=a.end();it++) f[it->second]++;
  20. for(i=1;i<=n;i++) printf("%d\n",f[i]);
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Standard output is empty