n = int(input())
data = list(map(int, input().split()))
positive = []
negative = []
for i in data:
if i > 0:
positive.append(i)
else:
negative.append(i)
positive.sort()
negative.sort(reverse=True)
count = 0
for i in positive:
for j in negative:
if i + j == 0:
count += 1
elif i + j < 0:
break
print(count)
CCF Python题解(100分)201403-1 相反数
最新推荐文章于 2024-04-26 17:29:42 发布