Pagini recente » Cod sursa (job #2878074) | Cod sursa (job #45225) | Cod sursa (job #1210497) | Cod sursa (job #139233) | Cod sursa (job #2840855)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f ("hashuri.in");
ofstream g ("hashuri.out");
int main()
{
unordered_map <int, int> M;
int n, option, x;
f >> n;
for (int i = 1; i <= n; i++)
{
f >> option >> x;
switch (option)
{
case 1:
M[x] = 1;
break;
case 2:
M.erase(x);
break;
case 3:
if (M.find(x) != M.end())
{
g << "1\n";
}
else
{
g << "0\n";
}
break;
}
}
}