Cod sursa(job #390345)
| Utilizator | Data | 3 februarie 2010 16:14:32 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.43 kb |
#include <fstream>
#include <hash_set.h>
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;
}
