题解 | #简单错误记录#
简单错误记录
https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb
a = []
b = []
c = []
while True:
try:
Data = input().split()
num = Data[1]
name = Data[0].split('\\')[-1]
if len(name) >16:
name = name[-16:]
if name not in a:
a.append(name)
b.append(Data[-1])
c.append(1)
else:
j = 0
k = []
for _ in a:
if _ == name:
k.append(j)
j+=1
for i in k:
if num == b[i]:
c[i]+=1
break
else:
a.append(name)
b.append(num)
c.append(1)
except:
break
for m,n,z in zip(a[-8:],b[-8:],c[-8:]):
print(m,n,z)
b = []
c = []
while True:
try:
Data = input().split()
num = Data[1]
name = Data[0].split('\\')[-1]
if len(name) >16:
name = name[-16:]
if name not in a:
a.append(name)
b.append(Data[-1])
c.append(1)
else:
j = 0
k = []
for _ in a:
if _ == name:
k.append(j)
j+=1
for i in k:
if num == b[i]:
c[i]+=1
break
else:
a.append(name)
b.append(num)
c.append(1)
except:
break
for m,n,z in zip(a[-8:],b[-8:],c[-8:]):
print(m,n,z)