Cod sursa(job #2281964)
Utilizator | Data | 12 noiembrie 2018 23:50:56 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.4 kb |
#include <bits/stdc++.h>
using namespace std;
unordered_set<int> S;
int main(){
freopen("hashuri.in","r",stdin);
freopen("hashuri.out","w",stdout);
int n;
scanf("%d",&n);
while(n--){
int tip,x;
scanf("%d %d",&tip,&x);
if(tip==1) S.insert(x);
else if(tip==2) S.erase(x);
else printf("%d\n",S.find(x)!=S.end());
}
return 0;
}