Morass

This?

Mar 1st, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. unordered_map<string,int> S;
  4. int main(void){
  5.     string s;
  6.     int N;
  7.     cin>>N;
  8.     for(int i(0);i<N;++i){
  9.         cin>>s;
  10.         if(S.count(s))cout<<s<<++S[s]<<endl;
  11.         else S[s]=0,cout<<"OK\n";
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment