Pagini recente » Cod sursa (job #675315) | Cod sursa (job #2524036) | Cod sursa (job #2702612)
#include <fstream>
#include <unordered_map>
using namespace std;
int n, cnt;
unordered_map <int, int> h;
int main() {
ios::sync_with_stdio(0);
int i, tip, x;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
f >> n;
for (i = 1; i <= n; i++) {
f >> tip >> x;
if (tip == 1 && h.find(x) == h.end()) h[x] = ++cnt;
if (tip == 2) h.erase(x);
if (tip == 3) g << (h.find(x) != h.end()) << '\n';
}
f.close();
g.close();
return 0;
}