Pagini recente » Cod sursa (job #3158317) | Cod sursa (job #712146) | Cod sursa (job #1982799) | Cod sursa (job #2911412) | Cod sursa (job #1253319)
#include <cstdio>
#include <map>
#define ll long long
#define h_value 65536*8-1
using namespace std;
ll n;
map <ll,ll> map_1;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%lld ",&n );
ll y;
int x;
map < ll , ll > :: iterator it;
while(n--){
scanf("%d %lld ",&x ,&y );
it = map_1.find(y);
if( x==1 ){
if(it == map_1.end()){
map_1.insert(pair<ll,ll>(y,y%h_value));
}
continue;
}
if( x == 2 ){
if(it != map_1.end())
map_1.erase(y);
continue;
}
if(it == map_1.end())
printf("0\n");
else
printf("1\n");
}
return 0;
}