Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- cin.ignore();
- map<string,int>mp;
- string s;
- while(n--)
- {
- getline(cin,s);
- if(mp[s]==0)
- {
- printf("OK\n");
- mp[s]++;
- }
- else
- {
- cout<<s<<mp[s]<<endl;
- mp[s]++;
- }
- s.clear();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement