Cod sursa(job #528441)

Utilizator Bogdan_tmmTirca Bogdan Bogdan_tmm Data 2 februarie 2011 20:44:28
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
#include <stdio.h>
#include <map>

using namespace std;

int N, NR;
map <int, int> M;

int main()
{
	freopen("hashuri.in", "r", stdin);
	freopen("hashuri.out", "w", stdout);

	int i, tip, x;

	scanf("%d ", &N);

	for (i = 1; i <= N; i++)
	{
		scanf("%d %d ", &tip, &x);

		if (tip == 1) M[x]=1;
		if (tip == 2) M.erase(x);
		if (tip == 3) printf("%d\n", M[x]!=0);
	}

	return 0;
}