Pagini recente » Cod sursa (job #733569) | Cod sursa (job #552959) | Cod sursa (job #30421) | Cod sursa (job #2579366) | Cod sursa (job #3172471)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map<int, bool> f;
int main() {
int q;
fin >> q;
while (q--) {
int tip, x;
fin >> tip >> x;
if (tip == 1) {
f[x] = true;
} else if (tip == 2) {
f[x] = false;
} else {
if (f.find(x) == f.end() || !f[x]) {
fout << "0\n";
} else {
fout << "1\n";
}
}
}
return 0;
}