Pagini recente » Cod sursa (job #1735636) | Cod sursa (job #2033327) | Cod sursa (job #2675091) | Cod sursa (job #2183444) | Cod sursa (job #2743575)
#include <bits/stdc++.h>
using namespace std;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
unordered_map <int, int> table;
int main()
{
int n, tip, x;
in >> n;
for(int i = 0; i < n; ++i)
{
in >> tip >> x;
if(tip == 1 and table.find(x) == table.end())
{
table[x] = 1;
}
else if(tip == 2)
{
table.erase(x);
}
else if(tip == 3)
{
if(table.find(x) != table.end())
out << 1 << "\n";
else
out << 0 << "\n";
}
}
return 0;
}