Pagini recente » Cod sursa (job #627899) | Cod sursa (job #2226003) | Cod sursa (job #541099) | Cod sursa (job #412090) | Cod sursa (job #2038309)
#include <cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int M=666013;
vector<int> v[M];
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n,i,l,k,c,x;
scanf("%d",&n);
for(i=1; i<=n; i++)
{
vector<int>::iterator it;
scanf("%d%d",&c,&x);
l=x%M;
it=find(v[l].begin(),v[l].end(),x);
if(it==v[l].end()){
if(c==1)
v[l].push_back(x);
if(c==3)
printf("0\n");
}
else{
if(c==2)
v[l].erase(it);
if(c==3)
printf("1\n");
}
}
return 0;
}