#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define ll long long
#define pb push_back
#define m_pi 2 * acos(0.0)
#define all(a) (a).begin(), (a).end()
#define LL_INF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
void solve();
constexpr bool isTc = 0;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
if (isTc)
{
int T;
cin >> T;
while (T--)
{
solve();
}
}
else
solve();
return 0;
}
/*######################################*/
void solve()
{
ll N, Q;
cin >> N >> Q;
vector<ll> V(N, -1);
ll ans = 0;
while(Q--)
{
ll x;
cin >> x;
if(x > 0)
{
ans = max(ans, ++V[x]);
}
else
{
V[-x] = -1;
}
}
cout << max(ans, 0ll) << "\n";
}
# | 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... |