Cod sursa(job #1697351)

Utilizator dcutitoiuCutitoiu Adrian-Nicolae dcutitoiu Data 1 mai 2016 18:35:41
Problema Hashuri Scor 40
Compilator cpp Status done
Runda Arhiva educationala Marime 0.53 kb
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
using namespace std;

int main() {

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

    map<int, int> hashMap;

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

    return 0;
}