Pagini recente » Cod sursa (job #926469) | Rating Popescu A (peste) | Cod sursa (job #2106872) | Cod sursa (job #2685797) | Cod sursa (job #518877)
Cod sursa(job #518877)
#include<cstdio>
#include<map>
using namespace std;
int n, ct;
map <int,int> h;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int tip, val;
scanf("%d",&n);
while(n--)
{
scanf("%d%d",&tip,&val);
if(tip==1 && h.find(val)==h.end())
h[val]=ct++;
else if(tip==2)
h.erase(val);
else if(tip==3)
printf("%d\n",h.find(val)!=h.end());
}
return 0;
}