Subscribe Us

Responsive Advertisement

Advertisement

C. Registration system codeforces solution

 problem : https://codeforces.com/problemset/problem/4/C



#include<bits/stdc++.h>

using namespace std;

main()

{

    int t;

    string a;

    map<string,int> ujjal;

    cin>>t;

    for(int i=0;i<t;i++)

    {

        cin>>a;

        if(ujjal[a]==0)

        {

            cout<<"OK"<<endl;

            ujjal[a]++;

        }


        else

        {

            cout<<a<<ujjal[a]<<endl;

            ujjal[a]++;

        }

    }





    return 0;

}

Post a Comment

0 Comments