Pagini recente » Cod sursa (job #2868846) | Cod sursa (job #2535197) | Cod sursa (job #1661029) | Cod sursa (job #51589) | Cod sursa (job #1259066)
#include <cstdio>
#include <map>
#define ll long long
using namespace std;
ll n,nr;
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 );
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;
}