Skip to content

Instantly share code, notes, and snippets.

@rabiulcste
Created August 19, 2016 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rabiulcste/5a4dc15cdf658853d9431f3909a8d93e to your computer and use it in GitHub Desktop.
Save rabiulcste/5a4dc15cdf658853d9431f3909a8d93e to your computer and use it in GitHub Desktop.
int main()
{
int n;
scanf("%d", &n);
map<string, int>mp;
for(int i=0; i<n; i++){
string s;
cin>>s;
if(mp[s] == 0) {mp[s]++; printf("OK\n");}
else {
cout<<s<<mp[s]<<endl;
mp[s]++;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment