Pagini recente » Cod sursa (job #432657) | Monitorul de evaluare | Cod sursa (job #2181690) | Cod sursa (job #1690392) | Cod sursa (job #1695546)
#include <bits/stdc++.h>
using namespace std;
unordered_set <int> H;
int main() {
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin.tie(0);
ios_base::sync_with_stdio(false);
int n; fin >> n;
for (int i = 0; i < n; ++ i) {
int opType, key; fin >> opType >> key;
if (opType == 1)
H.insert(key);
else if (opType == 2)
H.erase(key);
else
fout << (H.find(key) != H.end()) << '\n';
}
fin.close();
fout.close();
return 0;
}