Advertisement
Zinak

Untitled

Sep 8th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6.  map<string,ll>m;
  7.  map<string,ll>::iterator it;
  8.  ll n;
  9.  cin>>n;
  10.  string s,na;
  11.  while(n--){
  12.     cin>>s>>c;
  13.     cin>>na;
  14.     m[s]++;
  15.  }
  16.  for(it=m.begin();it!=m.end();it++)
  17.     cout<<it->first<<" "<<it->second<<endl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement