Cod sursa(job #307656)

Utilizator AndreiDDiaconeasa Andrei AndreiD Data 24 aprilie 2009 16:46:44
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.55 kb
#include <cstdio>
#include <set>
#include <algorithm>

using namespace std;

#define file_in "hashuri.in"
#define file_out "hashuri.out"



set<int> v;
int i,n,tip,x;


int main()
{
	freopen(file_in,"r",stdout);
	freopen(file_out,"w",stdout);
	
	scanf("%d", &n);
	for (i=1;i<=n;++i)
	{
		scanf("%d %d", &tip,&x);
		if (tip==1)
			v.insert(x);
		else
		if (tip==2)
			v.erase(x);
		else
		{
		if (v.find(x)==v.end())
             printf("0\n");
		else
			 printf("1\n");
		}
	}

	fclose(stdin);
	fclose(stdout);
	
	return 0;
}