Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <cstdlib>
- #include <algorithm>
- #include <cmath>
- #include <iomanip>
- #include <numeric>
- #include <vector>
- #include <string>
- #include <set>
- #include <map>
- #include <deque>
- using namespace std;
- #define ll long long
- void sherry()
- {
- ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- /*bool comp(pair <string,int> a,pair<string,int> b){
- return a.second < b.second;
- }*/
- int main()
- {
- sherry();
- ll t;
- cin >> t;
- map<string, ll> m;
- for (ll i = 0; i < t; i++)
- {
- string g;
- cin >> g;
- if (m.find(g) != m.end())
- {
- cout << g << m.count(g) << endl;
- }
- else
- {
- cout << "OK\n";
- }
- m[g]++;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment