专题博客链接
[题解]浙大Python PTA课后习题博客记录(Python)
原题题目
代码实现
numbers = int(input());highscores = {};key = [];value = [];count,save = 0,numbers//2
for i in range(numbers):
count+=1;temp = list(input().split())
if(count<=save):highscores[temp[1]] = temp[0]
else:key.append(temp[1]);value.append(temp[0])
key.reverse();value.reverse()
lowscores = dict(zip(key,value))
for i in highscores:
for j in lowscores:
if(highscores[i] == '0' and lowscores[j] == '1' or (highscores[i] == '1' and lowscores[j] == '0') ):
print("%s %s"%(i,j));del lowscores[j];break