Cod sursa(job #1410193)

Utilizator zpaePopescu Andreea zpae Data 30 martie 2015 22:10:52
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.48 kb
#include <fstream>
//#include <map>
#include<unordered_set>
using namespace std;
ifstream in ("hashuri.in");
ofstream out ("hashuri.out");
//map <int,int> v;
unordered_set <int> v;

int main()
{
    int m,i,t,x;
    in>>m;
    while(m--)
    {
        in>>t>>x;
        if(t==1)
            //v[x]=1;
            v.insert(x);
        else if(t==2)
            v.erase(x);
        else if(t==3)
            out<<(bool)(v.find(x)!=v.end())<<'\n';
    }
    return 0;
}