Cod sursa(job #714018)

Utilizator fhandreiAndrei Hareza fhandrei Data 15 martie 2012 11:29:19
Problema Hashuri Scor 30
Compilator cpp Status done
Runda Arhiva educationala Marime 0.57 kb
//Include
#include <cstdio>
using namespace std;

//Constante
const int MAX_SIZE = (int)2e9+1;

//Variabile
int n;
int tipOperatie, x;

bool hash[MAX_SIZE];

//Main
int main()
{
	freopen("hashuri.in", "rt", stdin);
	freopen("hashuri.out", "wt", stdout);
	
	scanf("%d", &n);
	for(int i=1 ; i<=n ; ++i)
	{
		scanf("%d%d", &tipOperatie, &x);
		
		switch(tipOperatie)
		{
			case 1: {hash[x] = true; break;}
			case 2: {hash[x] = false; break;}
			default: printf("%d\n", hash[x]? 1: 0);
		}
		
		
	}
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}