Cod sursa(job #1410187)

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

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