Cod sursa(job #1799938)

Utilizator StarGold2Emanuel Nrx StarGold2 Data 7 noiembrie 2016 01:13:17
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include <fstream>
#include <unordered_set>

std::ifstream in ( "hashuri.in"  );
std::ofstream out( "hashuri.out" );

std::unordered_set<int> mm;

int main( int argc, const char *argv[] ) {
    std::ios::sync_with_stdio( false );
    int n; in >> n;
    for( int i = 1; i <= n; i ++ ) {
        int t, x; in >> t >> x;
        switch( t ) {
            case 1: { mm.insert(x); break; }
            case 2: { mm.erase(x); break; }
            case 3: { out << ( mm.find(x) != mm.end() ) << "\n"; break; } } }
    return 0; }