Cod sursa(job #3214929)

Utilizator alexandraiacobelAlexandra Iacob alexandraiacobel Data 14 martie 2024 16:14:45
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.52 kb
#include <bits/stdc++.h>
using namespace std;

ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
const int Nmax = 1000005;
map<int,int> mp;
int n,op,x;
int main()
{
    fin>>n;
    for(int i=1; i<=n; i++)
    {
        fin>>op>>x;

        if(op==1)
            mp[x] = 1;

        else if(op==2)
            mp.erase(x);

        else if(op==3)
        {
            if(!mp.count(x))
               cout<<0<<'\n';
            else
                cout<<1<<'\n';
        }
    }
    return 0;
}