Pagini recente » Cod sursa (job #2337093) | Cod sursa (job #1273620) | Cod sursa (job #2664381) | Cod sursa (job #1257378) | Cod sursa (job #1729977)
#include <bits/stdc++.h>
using namespace std;
map <int,int > bgd;
using namespace std;
int n,i,v,x;
#define DIM 10000
char buff[DIM];
int poz=0;
void citeste(int &numar)
{
numar = 0;
while (buff[poz] < '0' || buff[poz] > '9')
if (++poz == DIM)
fread(buff,1,DIM,stdin),poz=0;
while ('0'<=buff[poz] && buff[poz]<='9')
{
numar = numar*10 + buff[poz] - '0';
if (++poz == DIM)
fread(buff,1,DIM,stdin),poz=0;
}
}
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
citeste(n);
for(i=1;i<=n;i++)
{
citeste(v),citeste(x);
if(v==1&&bgd[x]==0)
bgd[x]=1;
else
if(v==2&&bgd[x]==1)
bgd[x]=0;
else
if(v==3)
printf("%d\n",bgd[x]);
}
return 0;
}