sherry_ahmos

Untitled

May 1st, 2022 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. #include <iostream>
  2. #include <sstream>
  3. #include <cstdlib>
  4. #include <algorithm>
  5. #include <cmath>
  6. #include <iomanip>
  7. #include <numeric>
  8. #include <vector>
  9. #include <string>
  10. #include <set>
  11. #include <map>
  12. #include <deque>
  13. using namespace std;
  14. #define ll long long
  15.  
  16. void sherry()
  17. {
  18.     ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  19. #ifndef ONLINE_JUDGE
  20.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  21. #endif
  22. }
  23. /*bool comp(pair <string,int> a,pair<string,int> b){
  24.     return a.second < b.second;
  25. }*/
  26. int main()
  27. {
  28.     sherry();
  29.     ll t;
  30.     cin >> t;
  31.     map<string, ll> m;
  32.     for (ll i = 0; i < t; i++)
  33.     {
  34.         string g;
  35.         cin >> g;
  36.         if (m.find(g) != m.end())
  37.         {
  38.             cout << g << m.count(g) << endl;
  39.         }
  40.         else
  41.         {
  42.             cout << "OK\n";
  43.         }
  44.         m[g]++;
  45.     }
  46.     return 0;
  47. }
Add Comment
Please, Sign In to add comment