Pagini recente » Cod sursa (job #557665) | Cod sursa (job #5699) | Cod sursa (job #512104) | Cod sursa (job #274437) | Cod sursa (job #2765062)
#include <fstream>
#include <iostream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int x, n, op;
unordered_map<int, int> M;
int main() {
fin >> n;
for (; n != 0; n--) {
fin >> op >> x;
if (op == 1)
M[x] = 1;
else if (op == 2)
M.erase(x);
else if (op == 3)
fout << (M.find(x) != M.end()) << '\n';
}
return 0;
}