Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- max_score = max2_score = 0
- max_name = max2_name = ''
- count = 0
- count2 = 0
- for i in range(n):
- last_name, first_name, school, score = input().split()
- name = last_name + ' ' + first_name
- school, score = int(school), int(score)
- if school == 50:
- if score > max_score:
- max2_score = max_score
- max2_name = max_name
- count2 = count
- max_score = score
- max_name = name
- count = 1
- elif score == max_score:
- max2_name = name
- max2_score = score
- count += 1
- elif score > max2_score:
- max2_score = score
- max2_name = name
- count2 = 1
- elif score == max2_score:
- count2 += 1
- if count > 2:
- print(count)
- elif count == 2 or count == 1 and count2 == 1:
- print(max_name)
- print(max2_name)
- else:
- print(max_name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement