Cod sursa(job #1072627)
Utilizator | Data | 4 ianuarie 2014 18:03:10 | |
---|---|---|---|
Problema | Hashuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream cin( "hash.in" );
ofstream cout( "hash.out" );
int n, op, x;
set<int> a;
int main()
{
int i;
cin >> n;
for ( i = 1; i <= n; i++ )
{
cin >> op >> x;
if ( op == 1 ) a.insert( x );
else if ( op == 2 ) a.erase( x );
else cout << ( a.find( x ) != a.end() ) << '\n';
}
}