Cod sursa(job #423409)
| Utilizator | Data | 23 martie 2010 20:47:51 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.41 kb |
#include <hash_set.h>
#include <fstream>
using namespace std;
using namespace __gnu_cxx;
hash_set< int, hash<int> > v;
int main()
{int n, x, y;
ifstream in("hashuri.in");
ofstream out("hashuri.out");
in>>n;
for( ; n; --n )
{
in>>x>>y;
switch( x )
{
case 1: v.insert(y); break;
case 2: v.erase(y); break;
case 3: out<<( v.end() != v.find(y))<<'\n'; break;
}
}
return 0;
}
