Cod sursa(job #1842142)

Utilizator tavonSuleyman Magnificul tavon Data 6 ianuarie 2017 15:52:28
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.43 kb
#include<fstream>
#include<unordered_set>
using namespace std;
unordered_set<int> S;
int n,x,y;
int main(){
    freopen("hashuri.in","r",stdin);
    freopen("hashuri.out","w",stdout);
    scanf("%d",&n);
    while(n--){
        scanf("%d %d",&x,&y);
        if(x==1) S.insert(y);
        if(x==2) if( S.find(y) != S.end() ) S.erase( S.find(y) );
        if(x==3) printf("%d\n",( S.find(y) != S.end() ));
    }
    return 0;
}