Cod sursa(job #1506155)

Utilizator TeodorCotetCotet Teodor TeodorCotet Data 20 octombrie 2015 02:46:42
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.44 kb
#include <fstream>
#include <ctime>
#include <cstdlib>
#include <set>
#include <unordered_set>

using namespace std;


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

int N;

unordered_set<int> S;

int main() {

	
	int type; int x;

	fin >> N;
	while(N--) {

		fin >> type >> x;

		switch(type) {	

			case 1: S.insert(x); break;
			case 2:  S.erase(x); break;
			case 3: fout << (S.find(x) != S.end()) << '\n'; break;
		}
	}
	
	return 0;
}