Cod sursa(job #608295)

Utilizator soriynSorin Rita soriyn Data 16 august 2011 03:24:19
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include<stdio.h>
#include<hash_set.h>

using namespace std;
//using namespace __gnu_cxx;
hash_set<int,hash<int> > h;

int main()
{
	freopen("hashuri.in","r",stdin);
	freopen("hashuri.out","w",stdout);
	
	int n,x,y;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d %d",&x,&y);
		
		switch(x)
		{
		case 1: h.insert(y);break;
	    case 2: h.erase(y);break;
        case 3: printf("%d\n",h.end()!=h.find(y));break;
		}
	}
}