Cod sursa(job #2863276)

Utilizator QwertyDvorakQwerty Dvorak QwertyDvorak Data 6 martie 2022 15:50:22
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.56 kb
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define dbg(x) cout << #x <<": " << x << "\n";
using ll = long long;

const string myf = "hashuri";
ifstream fin(myf + ".in");
ofstream fout(myf + ".out");

int n;
int op, x;
map<int, int> m;
int main() {

	fin >> n;
	while (n--) {
		fin >> op >> x;
		if (op == 1)
			m[x] = 1;
		if (op == 2) {
			if (m.find(x) != m.end())
				m.erase(m.find(x));
		}
		if (op == 3)
			fout << (m.find(x) != m.end()) << '\n';
	}

	fin.close();
	fout.close();
	return 0;
}