Advertisement
Void-voiD

Untitled

Mar 6th, 2023
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | Source Code | 0 0
  1. n = int(input())
  2. a = [[]] * n
  3. for i in range(n):
  4.     k1, k2, k3, k4 = input().split()
  5.     a[i] = [int(k3), int(k4)]
  6.  
  7. mx = -10 ** 9
  8. ans = []
  9. for x in a:
  10.     score = x[1]
  11.     school = x[0]
  12.     if score == mx and not (school in ans):
  13.         ans.append(school)
  14.     elif score > mx:
  15.         mx = score
  16.         ans.clear()
  17.         ans.append(school)
  18.  
  19. print(*ans)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement