Pagini recente » Cod sursa (job #892725) | Cod sursa (job #1140066) | Cod sursa (job #526531) | Cod sursa (job #869164) | Cod sursa (job #1259068)
#include <cstdio>
#include <map>
using namespace std;
long long n,nr;
map <long long,long long> map_1;
int main()
{
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
scanf("%lld ",&n );
long long y;
int x;
map < long long , long long > :: iterator it;
while(n--){
scanf("%d %lld ",&x ,&y );
if( x == 1 ){
if(map_1.find(y) == map_1.end()){
map_1[y] = ++nr;
}
continue;
}
if( x == 2 ){
map_1.erase(y);
continue;
}
if(x == 3){
if(map_1.find(y) == map_1.end())
printf("0\n");
else
printf("1\n");
}
}
return 0;
}