Mai intai trebuie sa te autentifici.

Cod sursa(job #1569744)

Utilizator AlexandraaaaMereu Alexandra Alexandraaaa Data 15 ianuarie 2016 21:28:22
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.46 kb
#include <iostream>
#include <fstream>
#include <unordered_set>

using namespace std;

int main(){
	ifstream f("hashuri.in");
	ofstream g("hashuri.out");

	int n;
	unordered_set<int> H;

	f >> n;
	for (int i = 0; i < n; ++i){
		int x, y;
		f >> x >> y;
		if (x == 1)
			H.insert(y);
		if (x == 2)
			H.erase(y);
		if (x == 3)
			if (H.find(y) != H.end())
				g << 1 << "\n";
			else
				g << 0 << "\n";
	}

	f.close();
	g.close();

	return 0;
}