Cod sursa(job #1410020)
| Utilizator | Data | 30 martie 2015 20:12:25 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include<fstream>
#include<unordered_set>
using namespace std;
ifstream fi("hashuri.in");
ofstream fo("hashuri.out");
unordered_set <int> myHash;
int i,n,oper,x;
int main(){
fi>>n;
for(i=1;i<=n;i++){
fi>>oper>>x;
if(oper==1) myHash.insert(x);
else if(oper==2) myHash.erase(x);
else if(oper==3){
if(myHash.find(x)!=myHash.end()) fo<<"1\n";
else fo<<"0\n";
}
}
fi.close();
fo.close();
return 0;
}
