Cod sursa(job #500891)
Utilizator | Data | 13 noiembrie 2010 14:28:33 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include <fstream>
#include <hash_set>
using namespace std;
using namespace __gnu_cxx;
ifstream q ("hashuri.in");
ofstream w ("hashuri.out");
int T;
hash_set<int> H;
int main()
{for(q>>T;T;--T)
{int op, nr;
q>>op>>nr;
if(op==1)
H.insert(nr);
if(op==2)
H.erase(nr);
if(op==3)
w<<(H.find(nr)!=H.end())<<"\n";}}