最后一个测试点答案错误,得19分,老哥们看看是为啥
P,M,N = map(int, input().split(" "))
dict1 = {}
for i in range(P):
ipt_list = input().split(" ")
ipt_list[1] = int(ipt_list[1])
if ipt_list[0] not in dict1.keys():
dict1[ipt_list[0]] = [-1, -1, -1, -1]
dict1[ipt_list[0]][0] = ipt_list[1]
else:
dict1[ipt_list[0]][0] = ipt_list[1]
for i in range(M):
ipt_list = input().split(" ")
ipt_list[1] = int(ipt_list[1])
if ipt_list[0] not in dict1.keys():
dict1[ipt_list[0]] = [-1, -1, -1, -1]
dict1[ipt_list[0]][1] = ipt_list[1]
else:
dict1[ipt_list[0]][1] = ipt_list[1]
for i in range(N):
ipt_list = input().split(" ")
ipt_list[1] = int(ipt_list[1])
if ipt_list[0] not in dict1.keys():
dict1[ipt_list[0]] = [-1, -1, -1, -1]
dict1[ipt_list[0]][2] = ipt_list[1]
else:
dict1[ipt_list[0]][2] = ipt_list[1]
for i in dict1.keys():
if dict1[i][1] > dict1[i][2]:
dict1[i][3] = str(float(dict1[i][1] * 0.4 + dict1[i][2]*0.6))
a,b = dict1[i][3].split(".")
if int(b[0]) > 5:
dict1[i][3] = int(a) + 1
else:
dict1[i][3] = int(a)
else:
dict1[i][3] = dict1[i][2]
#dict1 = {'01234': [880, 39, 58, 58], 'a1903': [199, 86, 66, 74], 'ydjh2': [200, 98, 82, 88], 'wehu8': [300, 55, 84, 84], 'dx86w': [220, 88, 81, 84], 'missing': [400, -1, 99, 99], 'ydhfu77': [-1, 99, 88, 92]}
dict2 = {}
print(dict1)
for k,v in dict1.items():
if v[0]<200 or v[3]<60:
continue
# v = map(str,v)
# print(k," ".join(v))
dict2[k] = v
dict2_list = sorted(dict2.items(),key=lambda a:(-a[1][3],a[0]))
for i in dict2_list:
a = map(str,i[1])
print(i[0]," ".join(a))