Advertisement
Farz0l1x

Untitled

Apr 17th, 2024
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. file = open('9.txt')
  2. count = 0
  3. for s in file:
  4.     A = list(map(int, s.split()))
  5.     A.sort()
  6.     d = {elem: 0 for elem in A}
  7.     for elem in A:
  8.         d[elem] += 1
  9.     A_rep = []
  10.     A_unrep = []
  11.     for elem in d:
  12.         if d[elem] > 1:
  13.             A_rep += [elem]
  14.         else:
  15.             A_unrep += [elem]
  16.     if len(A_rep) == 0 and 3 * (A[0] + A[4]) <= 2 * (A[1] + A[2] + A[3]):
  17.         count += 1
  18. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement