Cod sursa(job #2356596)
Utilizator | Data | 26 februarie 2019 20:05:46 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.46 kb |
#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.insert(x);
else if(tip==2)
h.erase(x);
else h.find(x) == h.end() ? printf("0\n") : printf("1\n");
}
return 0;
}