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