Cod sursa(job #243897)

Utilizator andrei-alphaAndrei-Bogdan Antonescu andrei-alpha Data 14 ianuarie 2009 10:55:38
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.39 kb
#include <cstdio>  
#include <ext/hash_set>  
  
int N;  
__gnu_cxx::hash_set<int> S;  

int main()
{
	int N,x,y,nr;
	
	freopen("hashuri.in","r",stdin);
	freopen("hashuri.out","w",stdout);
	
	scanf("%d",&N);
	for(++N;--N;)
	{
		scanf("%d%d",&x,&y);
		if(x==1)
			S.insert(y);
		if(x==2)
			S.erase(y);
		if(x==3)
			printf("%d\n",S.find(y) != S.end() );
	}
	
	return 0;
}