Cod sursa(job #1697355)

Utilizator dcutitoiuCutitoiu Adrian-Nicolae dcutitoiu Data 1 mai 2016 18:54:22
Problema Hashuri Scor 40
Compilator cpp Status done
Runda Arhiva educationala Marime 0.56 kb
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;

int main() {

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

    unordered_map<int, char> hashMap;

    int comanda,x;
    in>>comanda;
    while(in>>comanda>>x){
        if(comanda==1){
            hashMap[x]='1';
        }
        if(comanda==2){
            hashMap[x]='0';
        }
        if(comanda==3){
            if(hashMap[x] == 0)
                hashMap[x]='0';
            out<<hashMap[x]<<'\n';
        }
    }

    return 0;
}