Pagini recente » Cod sursa (job #1475969) | Cod sursa (job #3201398) | Rating Streche Andrei Claudiu (StrecheAndrei) | Cod sursa (job #2256548) | Cod sursa (job #1037963)
#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);
}
}