Cod sursa(job #1081149)
| Utilizator | Data | 13 ianuarie 2014 11:28:45 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| 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() {
fi>>n;
for(;n;n--) {
fi>>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';}}}
