initial commit

This commit is contained in:
ShazidMahsrafi 2023-06-27 18:39:17 +06:00
parent e1aba23f0e
commit 14ba273992

View File

@ -0,0 +1,39 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n;
cin>>n;
unordered_map<string,int>m;
for(int i=0; i<n; ++i)
{
string s;
cin>>s;
auto it= m.find(s);
if(it==m.end())
{
m[s];
cout<<"OK"<<endl;
}
else
{
m[s]++;
s=s+to_string(m[s]);
m[s];
cout<<s<<endl;
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
//cin >> TC;
//cin.ignore();
while (TC--) solve();
}