Pagini recente » Cod sursa (job #1715161) | Cod sursa (job #2141888) | Cod sursa (job #2095220) | Cod sursa (job #1794447) | Cod sursa (job #1737028)
#include <cstdio>
#include <unordered_map>
#define DIM 3666013
using namespace std;
unordered_map<int,int> H;
char buffer[DIM];
int poz = DIM - 1;
void Scanf(int &A){
A = 0;
while('0' > buffer[poz] || buffer[poz] > '9')
if(++poz == DIM)
fread(buffer,1,DIM,stdin),poz = 0;
while('0' <= buffer[poz] && buffer[poz] <= '9')
{
A = A * 10 + buffer[poz] - 48;
if(++poz == DIM)
fread(buffer,1,DIM,stdin),poz = 0;
}
}
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int N,op,x;
Scanf(N);
for(auto i = 1; i <= N; ++i)
{
Scanf(op);
Scanf(x);
if(op == 1)
H[x] = 1;
else
if(op == 2)
H[x] = 0;
else
printf("%d\n",H[x]);
}
return 0;
}