Advertisement
jakaria_hossain

Codeforce - Registration system

Oct 7th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. cin>>n;
  7. cin.ignore();
  8. map<string,int>mp;
  9. string s;
  10. while(n--)
  11. {
  12. getline(cin,s);
  13. if(mp[s]==0)
  14. {
  15. printf("OK\n");
  16. mp[s]++;
  17. }
  18. else
  19. {
  20. cout<<s<<mp[s]<<endl;
  21. mp[s]++;
  22. }
  23. s.clear();
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement