Cod sursa(job #314093)

Utilizator toni2007Pripoae Teodor Anton toni2007 Data 10 mai 2009 16:22:07
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <cstdio>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

hash_map <int, bool> H;
int N;

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

	scanf("%d", &N);

	for ( ; N --; ) {
		scanf("%d%d", &tip, &val);
		if (tip == 1) {
                     H[val] = 1;
		} else if (tip == 2){
		     H[val] = 0;
		} else {
		     printf("%d\n", H[val]);
		}
	}
}