Pagini recente » Cod sursa (job #433037) | Cod sursa (job #1988095) | Cod sursa (job #2354913) | Cod sursa (job #1305855) | Cod sursa (job #1309249)
#include <cstdio>
#include <map>
using namespace std;
int n, type, i, x, qq;
map<int, int> kush;
int main ()
{
freopen("hashuri.in", "rt", stdin);
freopen("hashuri.out", "wt", stdout);
scanf("%d", &n);
for(i=1; i<=n; ++i)
{
scanf("%d%d", &type, &x);
if(type==1)
{
if(kush.find(x)==kush.end()) kush[x]=++qq;
continue;
}
if(type==2)
{
kush.erase(x);
continue;
}
printf("%d\n", kush.find(x)!=kush.end());
}
return 0;
}