Pagini recente » Cod sursa (job #285255) | Cod sursa (job #2921877) | Cod sursa (job #1266507) | Cod sursa (job #1896518) | 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;
}