Pagini recente » Cod sursa (job #2345412) | Cod sursa (job #481162) | Cod sursa (job #1121002) | Cod sursa (job #1947364) | Cod sursa (job #2392064)
#include<bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n, p, x, nr, minim, k;
set<int>v;
set<int>::iterator it;
int main()
{
f>>n;
for(int i=1; i<=n; i++)
{
f>>p;
if(p==1)
{
f>>x;
v.insert(x);
}
else if(p==2)
{
f>>x;
v.erase(x);
}
else
{
f>>x;
if(v.find(x)!=v.end()) g<<1<<'\n';
else g<<0<<'\n';
}
}
return 0;
}