Farz0l1x

Untitled

Feb 7th, 2024
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. def ravn(A):
  2.     count = 0
  3.     for i in range(1, len(A)):
  4.         if A[i] == A[i-1]:
  5.             count += 1
  6.     return count
  7.        
  8. file = open("in.txt")
  9. count = 0
  10. for elem in file:
  11.     A = list(map(int, elem.split()))
  12.     A.sort()
  13.     if (A[3] < A[0] + A[1] + A[2]) and (ravn(A) == 1):
  14.         count += 1
  15. print(count)
Advertisement
Add Comment
Please, Sign In to add comment