#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define mod 1000000007
#define sp << " " <<
#define endl << '\n'
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, Q;
cin >> N >> Q;
vector<int> part(N), part2(N);
int ret = 0;
for (int i = 0; i < Q; i++){
long long int K;
cin >> K;
if (K < 0){
part2[-K] = 0;
}else{
if (part2[K])
part[K]++;
else
part2[K] = 1;
ret = max(ret, part[K]);
}
}
cout << ret;
}
# | 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... |