Advertisement
sajid161

7:2

Jan 3rd, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int n;
  6.     cin>>n;
  7.     vector<string>v(n);
  8.     for(int i=0;i<n;i++)
  9.     {
  10.         cin>>v[i];
  11.     }
  12.     map<string,int>mp;
  13.     for(auto u:v)
  14.     {
  15.         if(mp[u]==0) cout<<"OK\n";
  16.         else cout<<u<<mp[u]<<endl;
  17.         mp[u]++;
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement