zsombi0806

eHazi q/27975

Nov 29th, 2019 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. from itertools import combinations
  2.  
  3. def f():
  4.     p = set()
  5.     n = int(input())
  6.     out = 0
  7.     input() #mert van ott egy random üres sor
  8.     for i in range(n):
  9.         p.add(int(input()))
  10.     for subset in combinations(p, 4):
  11.         s = sorted(subset)
  12.         if s[0] + s[3] == s[1] + s[2]:
  13.             out += 1
  14.     return out
Add Comment
Please, Sign In to add comment