Cod sursa(job #458114)
| Utilizator | Data | 23 mai 2010 11:26:45 | |
|---|---|---|---|
| Problema | Hashuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include<fstream>
#include<hash_set.h>
#define inf "hashuri.in"
#define outf "hashuri.out"
using namespace std;
using namespace __gnu_cxx;
fstream f(inf,ios::in),g(outf,ios::out);
int N;
hash_set< int, hash<int> > H;
void solve()
{
int op,x;
for( f>>N; N; --N )
{
f>>op>>x;
switch( op )
{
case 1 : H.insert(x); break;
case 2 : H.erase(x); break;
case 3 : g<< ( H.find(x)!=H.end() ) <<"\n";
}
}
}
int main()
{
solve();
f.close(); g.close();
return 0;
}
