Cod sursa(job #390347)
Utilizator | Data | 3 februarie 2010 16:18:06 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.42 kb |
#include <fstream>
#include <hash_set>
using namespace std;
using namespace __gnu_cxx;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
hash_set<int, hash<int> > H;
int main() {
int t;
for (fin >> t; t; --t) {
int op, val;
fin >> op >> val;
switch (op) {
case 1: H.insert(val); break;
case 2: H.erase(val); break;
default: fout << (H.find(val) != H.end()) << "\n";
}
}
return 0;
}