Cod sursa(job #1037963)

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

using namespace std;



int n,t,i,x,p;
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);
           p=a.find(x)!=a.end();
          if (t==3)
           printf("%d\n",p);
     }

}