Created
August 19, 2016 06:57
-
-
Save rabiulcste/5a4dc15cdf658853d9431f3909a8d93e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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