Cod sursa(job #1037968)

Utilizator robertstrecheStreche Robert robertstreche Data 20 noiembrie 2013 21:41:24
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <stdio.h>
#include <map>

using namespace std;



int n,t,i,x;
map <int,int>a;

int main()
{

    freopen ("hashuri.in","r",stdin);
    freopen ("hashuri.out","w",stdout);
    scanf("%d",&n);

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

         if (t==1)
           a[x]=1;
         if (t==2)
           a.erase(x);

          if (t==3)
           printf("%d\n",(a.find(x)!=a.end()));
     }

}