Pagini recente » Cod sursa (job #2354003) | Cod sursa (job #832490) | Cod sursa (job #2952266) | Cod sursa (job #1030834) | Cod sursa (job #1264425)
#include <fstream>
#include <map>
using namespace std;
map<int, int> h;
int main()
{
int i, n, x, op;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
fin >> n;
for (i = 1; i <= n; ++i)
{
fin >> op >>x;
if (op == 1)
{
if (h.find(x) == h.end()) h[x] = 1;
}
else if (op == 2) h.erase(x);
else if (h.find(x) == h.end()) fout << "0\n";
else fout << "1\n";
}
fin.close();
fout.close();
return 0;
}