Cod sursa(job #1901900)

Utilizator DariaPascuPascu Daria DariaPascu Data 4 martie 2017 11:53:56
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.45 kb
#include <bits/stdc++.h>

using namespace std;

int n;
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];

    else if(op == 2)
        hasht.erase(x);
    else
    {
        out << (hasht.find(x) != hasht.end()) ? 1 : 0;
        out << "\n";
    }
}


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