题解 | #简单错误记录#

简单错误记录

https://www.nowcoder.com/practice/2baa6aba39214d6ea91a2e03dff3fbeb

dic = {}
result = []
while True:
    try:
        ereport = input()
        fpath = ereport.split(' ')[0]
        numofrow = ereport.split(' ')[1]
        ffpath = fpath.split('\\')[-1]
        if len(ffpath) > 16:
            ffpath = ffpath[-16:]
        error = ' '.join([ffpath, numofrow])
        if error not in dic.keys():
            dic[error] = 0
        dic[error] += 1
        if dic[error] == 1:
            result.append(error)
    except:
        break
for i in result[-8:]:
    print(i, dic[i])

全部评论

相关推荐

点赞 评论 收藏
分享
手机爱睡觉:感觉是没hc了,上次双选hr说七月份就开了招了很多人
投递网易等公司10个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务