Cod sursa(job #2932625)

Utilizator namesurname01Name Surname namesurname01 Data 3 noiembrie 2022 12:51:06
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <fstream>
#include <unordered_map>

using namespace std;

unordered_map<int, bool> myMap;

int main() {
	ifstream f("hashuri.in");
	ofstream g("hashuri.out");
	int n, op, x;
	f >> n;
	while(n--) {
		f >> op >> x;
		if (op == 1) {
			myMap[x] = 1;
		}
		else {
			if (op == 2) {
				myMap[x] = 0;
			}
			else {
				g << myMap[x] << "\n";
			}
		}
	}

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