Cod sursa(job #441435)
/*
* File: main.cpp
* Author: VirtualDemon
*
* Created on April 12, 2010, 4:23 PM
*/
#include <sstream>
#include <cstdlib>
#include <fstream>
#include <tr1/unordered_set>
/*
*
*/
using namespace std;
using namespace tr1;
unordered_set< int > s;
string ss;
int main(int argc, char** argv)
{
int N, i, j;
ifstream in( "hashuri.in" );
ofstream out( "hashuri.out" );
getline( in, ss, (char)EOF );
istringstream ins( ss );
ins>>N;
for( ; N; --N )
{
ins>>i>>j;
switch( i )
{
case 1 : s.insert(j); break;
case 2 : s.erase(j); break;
case 3 : out<<( s.end() != s.find(j) )<<'\n';
}
}
return EXIT_SUCCESS;
}