Pagini recente » Cod sursa (job #2174814) | Cod sursa (job #2050780) | Cod sursa (job #1832071) | Cod sursa (job #666549) | Cod sursa (job #716961)
Cod sursa(job #716961)
#include <stdio.h>
#include <map>
using namespace std;
int n,op,x;
map <int,char> hs;
int main()
{
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
scanf("%d", &n);
for(int i=1;i<=n;++i)
{
scanf("%d %d", &op, &x);
if(op==1 && hs.find(x)==hs.end())
hs[x] = 0;
else if(op==2)
hs.erase(x);
else if(op==3)
printf("%d\n", hs.find(x)!=hs.end());
}
return 0;
}