Cod sursa(job #2281963)
Utilizator | Data | 12 noiembrie 2018 23:49:55 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.48 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){
if(S.find(x)!=S.end())
S.erase(x);
}
else printf("%d\n",S.find(x)!=S.end());
}
return 0;
}