-
Notifications
You must be signed in to change notification settings - Fork 0
/
4C.cpp
46 lines (46 loc) · 899 Bytes
/
4C.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Jai shree ram
// Author - Ajaybansal
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x.begin().x.end())
//#define for(i, n) for (int i = 0; i < n; i++)
#define endl "\n"
#define ff first
#define ss second
#define Yes cout << "YES" << endl
#define No cout << "NO" << endl
#define int long long
void fast()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void solve()
{
fast();
int t;
cin >> t;
string s;
unordered_map<string,int> m;
while(t--){
cin>>s;
m[s]++;
if(m[s]==1){
cout<<"OK"<<endl;
}
else{
cout<<s<<m[s]-1<<endl;
}
}
}
signed main()
{
solve();
}