Pagini recente » Cod sursa (job #2106943) | Cod sursa (job #1810238) | Cod sursa (job #1781790) | Diferente pentru problema/troll intre reviziile 32 si 4 | Cod sursa (job #2743069)
#include <bits/stdc++.h>
using namespace std;
ifstream F ("hashuri.in");
ofstream G ("hashuri.out");
unordered_set <int> h;
int main()
{
int n, op, x;
F>>n;
for(int i = 0; i < n; i++)
{
F>>op>>x;
if(op == 1)
{
h.insert(x);
}
else if(op == 2)
{
if(h.count(x))
h.erase(x);
}
else if (op == 3)
if(h.count(x))
G<<1<<'\n';
else G<<0<<'\n';
}
return 0;
}