Cod sursa(job #243197)

Utilizator toni2007Pripoae Teodor Anton toni2007 Data 12 ianuarie 2009 13:34:14
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.41 kb
#include <cstdio>
#include <map>

using namespace std;

#define FIN "hashuri.in"
#define FOUT "hashuri.out"

map<int,int> X;

int main(){
	int N, tip, x, Nr = 0;

	freopen(FIN, "r", stdin);
	freopen(FOUT, "w", stdout);
	
	scanf("%d", &N);
	
	while (N--){
		scanf("%d%d", &tip, &x);
		if (tip == 1 && X.find(x) == X.end())	X[x] = ++Nr;
		if (tip == 2)	X.erase(x);
		if (tip == 3) printf("%d\n", X.find(x) != X.end());
	}
}