Pagini recente » Cod sursa (job #1660247) | Cod sursa (job #618746) | Cod sursa (job #2392258) | Cod sursa (job #701519) | Cod sursa (job #2036833)
//#include<bits/stdc++.h>
#include <cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
#include<set>
using namespace std;
const int m=666013;
int h (int key)
{
return key%m;
}
set<int>v[m+5];
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n,i,j,tip,k,x,help;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d%d",&tip,&x);
help=h(x);
if(tip==1) v[help].insert(x);
else if(tip==2) v[help].erase(x);
else
{
if(v[help].find(x)!=v[help].end()) printf("1\n");
else printf("0\n");
}
}
return 0;
}