Cod sursa(job #1410181)

Utilizator zpaePopescu Andreea zpae Data 30 martie 2015 22:02:36
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.42 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,n=0;
    in>>m;
    while(m--)
    {
        in>>t>>x;
        if(t==1&&v.find(x)==v.end())
            v[x]=++n;
        if(t==2)
            v.erase(x);
        if(t==3)
            out<<(bool)(v.find(x)!=v.end())<<'\n';
    }
    return 0;
}