Cod sursa(job #1799936)

Utilizator StarGold2Emanuel Nrx StarGold2 Data 7 noiembrie 2016 01:08:55
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include <fstream>
#include <map>

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

std::map<int, 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[x] = 1; break; }
            case 2: { mm[x] = 0; break; }
            case 3: { out << mm[x] << "\n"; break; } } }
    return 0; }