Pagini recente » Cod sursa (job #1604544) | Cod sursa (job #487625) | Cod sursa (job #1535546) | Cod sursa (job #2137261) | Cod sursa (job #1977047)
#include <cstdio>
#include <map>
using namespace std;
map<int,int>ap;
int main()
{
freopen ("hashuri.in","r",stdin);
freopen ("hashuri.out","w",stdout);
int n;
scanf("%d",&n);
for(;n>0;--n)
{
int tip,val;
scanf("%d%d",&tip,&val);
if(tip==1) ap[val]++;
else if(tip==2&&ap[val]>0) --ap[val];
else if(tip==3)
{
if(ap[val]>0) printf("1\n");
else printf("0\n");
}
}
}