Cod sursa(job #1551671)

Utilizator Eman98Ghinea Mihail Emanuel Eman98 Data 16 decembrie 2015 11:34:54
Problema Hashuri Scor 20
Compilator cpp Status done
Runda Arhiva educationala Marime 0.46 kb
#include<fstream>
#include<map>
using namespace std;
ifstream cin("hashuri.in");
ofstream cout("hashuri.out");
int N,i,type,element,nr;
map <int,int>M;
int main()
{
    cin>>N;
    for(i=1;i<=N;i++)
    {
        cin>>type>>element;
        if(type==1 and M.find(element)==M.end())
            M[element]=++nr;
        else if(type==2)
            M.erase(element);
        else
            cout<<(M.find(element)!=M.end())<<"\n";
    }
    return 0;
}