Cod sursa(job #1081148)
Utilizator | Data | 13 ianuarie 2014 11:27:58 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.39 kb |
#include <fstream>
#include <ext/hash_set>
using namespace std;
ifstream fi("hashuri.in");
ofstream fo("hashuri.out");
__gnu_cxx::hash_set<unsigned>h;
unsigned n,x;int op;
int main() {
f>>n;
for(;n;n--) {
f>>op>>x;
switch(op) {
case 1:h.insert(x);break;
case 2:h.erase(x);break;
case 3:fo<<(h.find(x)!=h.end())<<'\n';}}}