Pagini recente » Cod sursa (job #2451362) | Cod sursa (job #1136400) | Cod sursa (job #429129) | Cod sursa (job #1616626) | Cod sursa (job #2528985)
#include <fstream>
#include <map>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
const int NMAX = 10000000;
map <int, int> m;
map <int, int>::iterator it;
int main()
{
int n, i, k, x;
fin>>n;
for(i=1;i<=n;i++)
{
fin>>k>>x;
if(k==1)///aduagu elemet
{
if(m.find(x)==m.end())
m[x] =1;
continue;
}
if(k==2)
{
it = m.find(x);
if(it!= m.end())
m.erase(it);
continue;
}
if(k==3)
{
it = m.find(x);
if(it!=m.end())
fout<<"1"<<"\n";
else
fout<<"0"<<"\n";
}
}
return 0;
}