Cod sursa(job #1061036)

Utilizator alexandru70Ungurianu Alexandru alexandru70 Data 19 decembrie 2013 08:23:28
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.35 kb
#include <fstream>
#include <unordered_set>

using namespace std;

ifstream in("hashuri.in"); ofstream out("hashuri.out");

unordered_set<int> h;
int n;

int main() {
	in >> n;
	while(n--) {
		int a,b;
		in >> a >> b;
		switch(a) {
			case 1:h.insert(b);break;
			case 2:h.erase(b);break;
			case 3:out << h.count(b)==0?0:1 << '\n';break;
		}
	}
	return 0;
}