Cod sursa(job #2343068)

Utilizator Andrei-27Arhire Andrei Andrei-27 Data 13 februarie 2019 17:42:11
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <bits/stdc++.h>
using namespace std ;
ifstream in ("hashuri.in") ;
ofstream out ("hashuri.out") ;
int n , tip , x ;
map < int , bool > m ;
int main ()
{
    in >> n ;
    while ( n -- )
    {
        in >> tip >> x ;
        if ( tip == 1 ) if ( m.find( x ) == m.end() ) m [ x ] = 1 ;
        if ( tip == 2 ) m.erase( x ) ;
        if ( tip == 3 ) out << ( m.find( x ) != m.end() ) << '\n' ;
    }
}