Cod sursa(job #1096377)

Utilizator pulseOvidiu Giorgi pulse Data 1 februarie 2014 22:02:25
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <stdio.h>
#include <map>

using namespace std;

int T, count;
map <int, int> M;

int main ()
{
	freopen ("hashuri.in", "r", stdin);
	freopen ("hashuri.out", "w", stdout);
	scanf ("%d", &T);
	while (T--)
	{
		int type, x;
		scanf ("%d %d", &type, &x);
		if (type == 1 && M.find (x) == M.end ()) M[x] = ++count;
		if (type == 2) M.erase (x);
		if (type == 3) printf ("%d\n", M.find (x) != M.end ());
	}
	return 0;
}