Pagini recente » Cod sursa (job #1371360) | Cod sursa (job #1701441) | Cod sursa (job #3031273) | Cod sursa (job #771932) | Cod sursa (job #2645804)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
unordered_set <int> x;
unordered_set <int> ::iterator y;
int n,i,aux;
fin>>n;
int op,nr;
for(i=1; i<=n; i++)
{
fin>>op>>nr;
if(op == 1)
{
x.insert(nr);
}
if(op == 2)
{
y = x.find(nr);
if(y!=x.end())
{
x.erase(nr);
}
}
if(op == 3)
{
y = x.find(nr);
if(y!=x.end())
{
fout<<"1"<<"\n";
}
else
{
fout<<"0"<<"\n";
}
}
}
return 0;
}