-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegistration System
136 lines (109 loc) · 1.91 KB
/
Registration System
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <bits/stdc++.h>
#define ll long long
#define Mohamed cout<<"YES"<<endl;
#define Awad cout<<"NO"<<endl;
#define test int t=0;cin>>t;while(t--)
#define Done return 0;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define clr(v, d) memset(v, d, sizeof(v))
#define endl "\n"
const int S = 1e6 + 5;
using namespace std;
vector<ll> prefix(int n , vector<int> a)
{
ll sum=a[0];
vector<ll>pre(n);
pre[0]=a[0];
for(int i=1;i<n;i++)
{
pre[i] =a[i]+sum;
sum=pre[i];
}
return pre;
}
void down(string &s)
{
transform(s.begin(),s.end(),s.begin(),:: tolower);
}
void up(string &s)
{
transform(s.begin(),s.end(),s.begin(),::toupper);
}
string convert_to_binary(int Decimal_Number)
{
string s;
while(Decimal_Number)
{
if(Decimal_Number%2!=0)
{
s.push_back('1');
}
else
{
s.push_back('0');
}
Decimal_Number/=2;
}
reverse(s.begin(),s.end());
return s;
}
int convert_to_decimal(string binary_number)
{
ll ans=0;
int j=0;
for(int i = binary_number.size()-1 ;i >=0; i--)
{
if(binary_number[i]=='1')ans+=pow(2,j);
j++;
}
return ans;
}
int binary(int n,int x,vector<int>a) {
a.resize(S,0);
int l = 0, r = n-1;
int ans = -1;
while (l <= r) //{1,2,3,4,5,6,7}
{
ll mid = (l + r) / 2;
if (x == a[mid])
{
ans = mid;
r=mid-1;
}
else if (a[mid] < x) {
l = mid + 1;
} else {
r = mid - 1;
}
}
a.clear();
return ans;
}
bool check(ll n){
if(n == 1) return false;
ll t = sqrt(n);
if(t * t != n) return false;
for(int i = 2 ;i <= sqrt(t) ;i++)
if(t % i == 0) return false;
return true;
}
void solve() {
int n;
cin >> n;
// set<string> myset;
string s;
map<string, int> mp;
while (n--) {
cin >> s;
if (mp[s] == 0)
cout << "OK" << endl;
else
cout << s << mp[s] << endl;
mp[s]++;
}
}
int main()
{
fast
solve();
}