Pagini recente » Cod sursa (job #1576428) | Cod sursa (job #2891385) | Cod sursa (job #2938650) | Cod sursa (job #2025121) | Cod sursa (job #1519888)
#include <bits/stdc++.h>
#include <limits>
#include <math.h>
#include <unordered_map>
using namespace std;
//const int m = 1e9+7;
//const double e = 1e-8;
//long long lgPow(long long a, long long b);
//int binarySearch(int x, int n);
//void sieve(int n);
//inline int gcd(int a, int b);
//const int N = 100;
//int st[N+5], dr[50], sp[50];
//bool ciur[N+5];
//int a[N+5];
//int d[N+5];
//int v[N+5];
//char m[N+5][N+5];
//vector < pair <string, int> > v;
//map <int, int> m;
//bool a[26];
//char s[N+5];
//string s;
unordered_map <int, bool> m;
int main()
{
int x,op,n,i;
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
scanf("%d",&n);
for(i = 1;i <= n;i++){
scanf("%d %d",&op,&x);
if(op == 1){
m[x] = 1;
}else if(op == 2){
m[x] = 0;
}else{
printf("%d\n",m[x] == 1);
}
}
return 0;
}
//long long lgPow(long long a, long long b){
// long long sol = 1;
// while(b){
// if(b&1){
// sol = sol*a;
// }
// a = a*a;
// b >>= 1;
// }
// return sol;
//}
//int binarySearch(int x, int n){
// int step,i;
// for(step = 1;step <= n;step <<= 1);
// for(i = 0;step;step >>= 1){
// if(i + step <= n && v[i+step] <= x){
// i += step;
// }
// }
// if(v[i] == x){
// return i;
// }
// return -1;
//}
//void sieve(int n){
// int i,j;
// for(i = 4;i <= n;i += 2){
// ciur[i] = 1;
// }
// for(i = 3;i <= n;i += 2){
// if(!ciur[i]){
// for(j = 3*i;j <= n;j += i+i){
// ciur[j] = 1;
// }
// }
// }
//}
//inline int gcd(int a, int b){
// if(b == 0) return a;
// return gcd(b,a%b);
//}