Pagini recente » Cod sursa (job #2124815) | Cod sursa (job #2444607) | Cod sursa (job #240324) | Cod sursa (job #1802565) | Cod sursa (job #2356603)
#include <bits/stdc++.h>
using namespace std;
int N, tip, x;
unordered_set<int> h;
int main(){
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
scanf("%d", &N);
for(int i = 0; i < N; i++){
scanf("%d%d", &tip, &x);
if(tip==1 && h.find(x) == h.end())
h.insert(x);
else if(tip==2)
h.erase(x);
else h.find(x) == h.end() ? printf("0\n") : printf("1\n");
}
return 0;
}