Cod sursa(job #3287103)

Utilizator Radu_Stefan2010Radu Loga Radu_Stefan2010 Data 15 martie 2025 17:05:49
Problema Hashuri Scor 40
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.39 kb
#include <bits/stdc++.h>

using namespace std;

ifstream in("hashuri.in");
ofstream out("hashuri.out");

int n,x,op;
unordered_map<int,int>f;

int main()
{
    in>>n;
    for(int i=1;i<=n;i++)
    {
        in>>op>>x;
        if(op==1)
            f[x]++;
        else if(op==2)
            f[x]=max(--f[x],0);
        else
            out<<f[x]%2<<'\n';
    }
    return 0;
}