Pagini recente » Cod sursa (job #2247412) | Cod sursa (job #717104) | Cod sursa (job #1139922) | Cod sursa (job #2705881) | Cod sursa (job #2834421)
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
ifstream f ("hashuri.in");
ofstream g ("hashuri.out");
int main()
{
unordered_map <int, int> Map;
int n;
f >> n;
for (int i = 1; i <= n; i++)
{
int option, x;
f >> option >> x;
switch (option)
{
case 1:
if (Map.count(x) == false)
{
Map.insert(make_pair(x, 0));
}
break;
case 2:
Map.erase(x);
break;
case 3:
g << (Map.count(x)) << "\n";
break;
}
}
}