Pagini recente » Cod sursa (job #101329) | Cod sursa (job #2802588) | Cod sursa (job #3214334) | Cod sursa (job #1022310) | Cod sursa (job #1018948)
#include <iostream>
#include <cstdio>
#include <tr1/unordered_set>
using namespace std;
using namespace std::tr1;
int n;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%d",&n);
unordered_set<int> hesh;
unordered_set<int>::iterator got;
int a,b;
for(int k=1;k<=n;k++)
{
scanf("%d %d",&a,&b);
if(a==1)
{
got=hesh.find(b);
if(got==hesh.end())
hesh.insert(b);
}
else
if(a==2)
hesh.erase(b);
else
if(a==3)
{
got=hesh.find(b);
if(got==hesh.end())
printf("0\n");
else
printf("1\n");
}
}
return 0;
}