Cod sursa(job #1309255)

Utilizator serban_ioan97Ciofu Serban serban_ioan97 Data 5 ianuarie 2015 16:42:01
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.48 kb
#include <cstdio>
#include <map>

using namespace std;

int n, type, i, x, qq;
map<int, int> kush;

int main ()
{
    freopen("hashuri.in", "rt", stdin);
    freopen("hashuri.out", "wt", stdout);

    scanf("%d", &n);

    for(i=1; i<=n; ++i)
    {
        scanf("%d%d", &type, &x);

        if(type==1 && kush.find(x)==kush.end()) kush[x]=++qq;
        if(type==2) kush.erase(x);
        if(type==3) printf("%d\n", kush.find(x)!=kush.end());
    }
    return 0;
}