#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
int n;
cin>>n;
int a[n];
map<int,bool>positive,negative;
for(int i=0;i<n;i++)
{
cin>>a[i];
if(a[i]>0)
positive[a[i]]=true;
if(a[i]<0)
negative[a[i]]=true;
}
int k,num=0;
for(auto it=negative.begin();it!=negative.end();it++)
{
k=abs(it->first);
if(positive[k])
num++;
}
cout<<num;
return 0;
}
04-17
03-26
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交