#include <iostream>
#include <string>
#include <map>
using namespace std;
int n;
int main()
{
string str;
map<string,int> q;
cin >> n;
for(int i = 1;i <= n;i ++)
{
cin >> str;
if(q[str] > 0)
{
cout << str << q[str] << endl;
q[str] ++;
}
else
{
cout << "OK" << endl;
q[str] = 1;
}
}
return 0;
}
CodeForces 4C
最新推荐文章于 2019-11-20 18:23:24 发布