Pagini recente » Cod sursa (job #1923282) | Cod sursa (job #2547589) | Cod sursa (job #2276464) | Borderou de evaluare (job #406666) | Cod sursa (job #1922084)
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int n, nr=0;
map <int, int> m;
int main()
{
int i, op, x;
fin>>n;
for(i=1; i<=n; i++)
{
fin>>op>>x;
if(op==1 && m.find(x)==m.end())
m[x]=++nr;
else if(op==2)
m.erase(x);
else if(op==3)
fout<<(m.find(x)!=m.end())<<'\n';
}
return 0;
}