CodeForces 4C

#include 
#include 
#include 
using namespace std;

int n;

int main()
{
    string str;
    map 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;
}




你可能感兴趣的:(codeforce,简单题)