Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import combinations
- def f():
- p = set()
- n = int(input())
- out = 0
- input() #mert van ott egy random üres sor
- for i in range(n):
- p.add(int(input()))
- for subset in combinations(p, 4):
- s = sorted(subset)
- if s[0] + s[3] == s[1] + s[2]:
- out += 1
- return out
Add Comment
Please, Sign In to add comment