Cod sursa(job #1800938)
Utilizator | Data | 8 noiembrie 2016 13:48:15 | |
---|---|---|---|
Problema | Hashuri | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <fstream>
#include <set>
using namespace std;
ofstream fout ("hashuri.out");
ifstream fin ("hashuri.in");
set < int > s;
int n,a,b;
int main()
{
fin>>n;
while( n-- )
{
fin>>a>>b;
if( a == 1 )
s.insert( b );
if( a == 2 && s.find( b ) != s.end() )
s.erase( b );
if( a == 3 )
fout<<( s.find( b ) != s.end() ? '1' : '0')<<'\n' ;
}
return 0;
}