Python3 解法
简单错误记录
http://www.nowcoder.com/questionTerminal/2baa6aba39214d6ea91a2e03dff3fbeb
import sys from collections import defaultdict data = map(lambda x:x.split('\\')[-1] ,sys.stdin.readlines()) errors = defaultdict(int) result = list() for d in data: name,line = d.strip().split() error = ' '.join([name[-16:],line]) errors[error] += 1 if errors[error] == 1: result.append(error) for r in result[-8:]: print(r,errors[r])