Cod sursa(job #1901925)

Utilizator DariaPascuPascu Daria DariaPascu Data 4 martie 2017 12:00:23
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.43 kb
#include <bits/stdc++.h>

using namespace std;

int n;
unordered_map <int,int> hasht;

int main()
{
ifstream in ("hashuri.in");
ofstream out ("hashuri.out");

in >> n;
while (n--)
{
    int op, x;
    in >> op >> x;
    if(op == 1)
       hasht[x] = 1;
    else if(op == 2)
        hasht.erase(x);
    else
        out << (hasht.find(x) != hasht.end()) << '\n';
}


in.close();
out.close();
    return 0;
}