Cod sursa(job #706001)

Utilizator BeniLehelBeni Lehel BeniLehel Data 5 martie 2012 12:38:44
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.7 kb
#include<algorithm>
#include<stdio.h>
#include<vector>
#include <set>
using namespace std;

set <long long> st;
set<long long>::iterator it;

long long n,q,w;

void be()
{
	it=st.find(w);
	if(it == st.end() )
		st.insert(w);
}
void torol()
{
	it=st.find(w);
	if(it!=st.end())
		st.erase(it);
}
void ki()
{
	it=st.find(w);
	if(it != st.end())
		printf("1\n");
	else
		printf("0\n");
}

int main()
{
	freopen("hashuri.in","r",stdin);
	freopen("hashuri.out","w",stdout);
	scanf("%lld",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%lld%lld",&q,&w);
		switch(q)
		{
		case 1:be();break;
		case 2:torol();break;
		case 3:ki();break;
		default: break;
		}
			
	}
	return 0;
}