Solution to the problem number 10420 of UVA - 10420.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;

int main()
{
 int n; cin>>n;
 map<string,int> M;
 string str,line;
 while(n--)
 {
     cin>>str; getline(cin,line);
     M[str]++;
 }
 for(auto m:M)
 {
     cout<<m.first<<' '<<m.second<<'\n';
 }
 return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!