Submission #1227255

#TimeUsernameProblemLanguageResultExecution timeMemory
1227255acoatoitgsInfinite Race (EGOI24_infiniterace2)C++20
29 / 100
13 ms1864 KiB
#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, 0);
    bitset<200005> ret;

    ll ans = 0;
    while(Q--)
    {
        ll x;
        cin >> x;
        if(x > 0)
        {
            if(!ret[x]) ret[x] = 1;
            else V[x]++;
        }
        else
        {
            ret[-x] = 0;
        }

    }

    cout << *max_element(all(V)) << "\n";
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...