Pagini recente » Cod sursa (job #961133) | Monitorul de evaluare | Cod sursa (job #1189807) | Cod sursa (job #1337347) | Cod sursa (job #673905)
Cod sursa(job #673905)
#include <fstream>
#include <set>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
int n,c;
long long x;
set < int > h;
set < int >::iterator it;
int main()
{f>>n;
for(register int i=1;i<=n;i++)
{f>>c;
if(c==1){f>>x;
h.insert(x);
}
else if(c==2){f>>x;
h.erase(x);
}
else {f>>x;
it=h.find(x);
if(*it)g<<"1\n";
else g<<"0\n";
}
}
return 0;
}