Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = map(int, input().split())
- a = list(map(int, input().split()))
- count = 0
- for i in range(n - 1):
- a_i = a[i]
- a_j = m - a_i
- if 0 <= a_j < a_i:
- count += a[i + 1:].count(a_j)
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement