Cod sursa(job #2744130)

Utilizator Octavian21Chiriac Octavian Octavian21 Data 23 aprilie 2021 22:00:04
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.61 kb
#include <bits/stdc++.h>

using namespace std;

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


unordered_map <int,int> mapp;

int main()
{
    int n,x,y;
    fin>>n;
    for(int i=0;i<n;++i)
    {
        fin>>x>>y;
        if(x==1 and mapp.find(y) == mapp.end())
        {
            mapp[y] =1;
        }
        else if(x==2)
        {
            mapp.erase(y);
        }
        else if(x==3)
        {
            if( mapp.find(y) != mapp.end())
                fout<<1<<"\n";
            else
                fout<<0<<"\n";

        }
    }
    return 0;
}