Cod sursa(job #424990)

Utilizator za_wolfpalianos cristian za_wolf Data 25 martie 2010 13:28:05
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.45 kb
//#include "stdafx.h"
#include<stdio.h>
#include<set>
using namespace std;
set <int> x;
int i,n,k,p;
int main()
{
	freopen("hashuri.in","r",stdin);
	freopen("hashuri.out","w",stdout);
	scanf("%d",&n);
	for (i=1;i<=n;i++)
	{
		scanf("%d%d",&k,&p);
		if (k==1) x.insert(p);
		if (k==2) 	if (x.find(p)!=x.end()) x.erase(x.find(p));
		if (k==3)	
			if (x.find(p)!=x.end())
				printf("1\n");
			else
				printf("0\n");
	}


	return 0;
}