Cod sursa(job #1279849)

Utilizator diana-t95FMI Tudoreanu Diana Elena diana-t95 Data 30 noiembrie 2014 23:22:23
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.43 kb
#include <iostream>
#include <fstream>
#include <unordered_map>
using namespace std;
unordered_map <int> mymap;
int main()
{
    ifstream f("hashuri.in");
    ofstream g("hashuri.out");
    int n, i, op, x;
    f>>n;
    for (i=0;i<n;i++)
    {
        f>>op>>x;
        if (op==1) mymap.insert(x);
        if (op==2) mymap.erase(x);
        if (op==3) if (mymap.find(x)!=mymap.end()) g<<"1\n"; else g<<"0\n";
    }
}