Cod sursa(job #1037972)

Utilizator robertstrecheStreche Robert robertstreche Data 20 noiembrie 2013 21:43:07
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include <stdio.h>
#include <unordered_map>

using namespace std;



int n,t,i,x;
unordered_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.find(x)==a.end())
           a[x]=1;
         if (t==2 && a.find(x)!=a.end())
           a.erase(x);

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

}