Pagini recente » Cod sursa (job #1602017) | Borderou de evaluare (job #1567174) | Cod sursa (job #14208) | Cod sursa (job #798238) | Cod sursa (job #1235882)
#include <stdio.h>
#include <unordered_set>
typedef std::unordered_set<int> iset;
typedef iset::iterator iset_itr;
int main(){
freopen("hashuri.in", "r", stdin);
freopen("hashuri.out", "w", stdout);
int n, op, nr;
iset hash;
iset_itr it;
scanf("%d", &n);
for (int i = 0; i < n; ++i){
scanf("%d %d", &op, &nr);
if (op == 1) hash.insert(nr);
else if (op == 2) hash.erase(nr);
else if (hash.find(nr) == hash.end())
printf("0\n");
else
printf("1\n");
}
}