题解 | #简单错误记录#
简单错误记录
https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb
from math import exp from pickle import TRUE import sys q = [] dic = {} def func(): line = input() msg = line.split(' ') msg = msg[0].split('\\')[-1][-16:] + ' ' + msg[1] if msg in dic: dic[msg] += 1 else: q.append(msg) dic[msg] = 1 while True: try: func() except: break for msg in q[-8:]: print(msg, dic[msg])