Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def func(i):
- return int(i[3])
- a = open("input.txt", "r", encoding='utf-8')
- b = open("output.txt", "w", encoding='utf-8')
- data = []
- for x in a.readlines():
- data.append(x.split())
- data.sort(key=func, reverse=True)
- count = 0
- mx1 = int(data[0][3])
- mx2 = 10 ** 9
- fn = ''
- ln = ''
- for x in data:
- score = int(x[3])
- if score < mx1 and mx2 == -1:
- count += 1
- fn = x[0]
- ln = x[1]
- mx2 = score
- elif score == mx2:
- count += 1
- if count > 1:
- print(count, file=b, end='')
- elif count == 1:
- print(fn, ln, file=b, end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement