题解 | #简单错误记录#
简单错误记录
https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb
a, b = [], [] while True: try: a.append(input().split()) except: break for i in range(len(a)): s = a[i][0] s = s [::-1] for j in range(len(s)): if s[j] == '\\': s = s[:j] break elif j == 15: s = s[:16] break a[i][0] = s[::-1] for i in range(len(a)): if a[i] in a[:i]: a.insert(a.index(a[i])+1, a[i]) a.pop(i+1) for i in range(len(a)): if a[i] not in b: b.append(a[i]) b.append(1) else: b[b.index(a[i])+1] += 1 if len(b) > 16: b = b[-16:] for i in range((len(b)+1)//2): print(b[2*i][0], b[2*i][1], b[2*i+1])