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;
int main()
{
int n, q;
cin>>n>>q;
int A[n];
memset(A, -1, sizeof(A));
int res=0;
int x;
for(int i=0;i<q;i++)
{
cin>>x;
if(x<=0)
{
x*=-1;
A[x]=-1;
}
else
{
if(A[x]!=res)
{
A[x]=res;
}
else
{
res++;
A[x]=res;
}
}
}
cout<<res<<endl;
return 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... |