题解 | #简单错误记录#
简单错误记录
https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb
d = dict()
l = []
while True:
try:
f = input().split('\\')[::-1][0]
if len(f) > 20:
name = f[(len(f)-20):]
else:
name = f[:]
if name not in d:
d[name] = 1
else:
d[name] = d[name]+1
except:
break
if len(d) > 8:
p = len(d) - 8
t = -1
for i in d:
t += 1
if t < p:
continue
else:
print(i,d[i])
else:
for i in d:
print(i,d[i])