Pagini recente » Cod sursa (job #163588) | Cod sursa (job #538801) | Cod sursa (job #446557) | Cod sursa (job #2089201) | Cod sursa (job #2734765)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_map<int, int> h;
int hashh, n;
int main()
{
int i, op, x, da;
fin >> n;
for(i = 1; i <= n; i++)
{
fin >> op;
fin >> x;
if(op == 1)
h[x] = 1;
if (op == 2)
{
da = 0;
for (auto& elem: h)
if(x == elem.first)
{
da = 1;
break;
}
if(da == 1)
h.erase(x);
}
if(op == 3)
{
if(h[x] == 1)
fout << "1\n";
else fout << "0\n";
}
}
return 0;
}