Cod sursa(job #1342394)

Utilizator ooptNemes Alin oopt Data 13 februarie 2015 22:50:59
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
// hashuri
#include <iostream>
#include <fstream>
#include <unordered_map>

using namespace std;

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

int n;
unordered_map<int, bool> mp;

void read() {
	f>>n;
	for (int i=1;i<=n;i++) {
		int type; f>>type;
		int x; f>>x;
		if (type == 1) {
			mp[x] = 1;
		} else if (type == 2) {
			mp.erase(x);
		} else if (type == 3) {
			g<<(mp.find(x) != mp.end())<<'\n';
		}
	}
}

int main() {

	read();

	f.close(); g.close();
	return 0;
}