1 题目描述(题目链接)
2 题解
记录每个名字出现的次数。
import collections
n = int(input())
names = collections.defaultdict(int)
res = []
for i in range(n):
name = input()
if name not in names:
res.append('OK')
else:
res.append(name + str(names[name]))
names[name] += 1
for i in res:
print(i)