Pagini recente » Cod sursa (job #270631) | Cod sursa (job #2864249) | Cod sursa (job #549663) | Cod sursa (job #2303936) | Cod sursa (job #714018)
Cod sursa(job #714018)
//Include
#include <cstdio>
using namespace std;
//Constante
const int MAX_SIZE = (int)2e9+1;
//Variabile
int n;
int tipOperatie, x;
bool hash[MAX_SIZE];
//Main
int main()
{
freopen("hashuri.in", "rt", stdin);
freopen("hashuri.out", "wt", stdout);
scanf("%d", &n);
for(int i=1 ; i<=n ; ++i)
{
scanf("%d%d", &tipOperatie, &x);
switch(tipOperatie)
{
case 1: {hash[x] = true; break;}
case 2: {hash[x] = false; break;}
default: printf("%d\n", hash[x]? 1: 0);
}
}
fclose(stdin);
fclose(stdout);
return 0;
}