This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define itn long long
#define int long long
#define ff first
#define ss second
#define pb push_back
map<int,int>mp;
map<int,int>urd;
signed main(){
int n,q;
cin>>n>>q;
for(int i=0;i<n;i++)mp[i]=-1;
while(q--){
int x;
cin>>x;
if(x<0){
x*=-1;
if(urd[x]){
mp[x]++;
}
urd[x]=1;
}
else{
if(urd[x]==0){
mp[0]++;
}
urd[x]=0;
}
}
cout<<mp[0];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |