Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- a = [[]] * n
- for i in range(n):
- k1, k2, k3, k4 = input().split()
- a[i] = [int(k3), int(k4)]
- mx = -10 ** 9
- ans = []
- for x in a:
- score = x[1]
- school = x[0]
- if score == mx and not (school in ans):
- ans.append(school)
- elif score > mx:
- mx = score
- ans.clear()
- ans.append(school)
- print(*ans)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement