Cod sursa(job #2904839)

Utilizator andreiiorgulescuandrei iorgulescu andreiiorgulescu Data 18 mai 2022 09:52:28
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.44 kb
#include <bits/stdc++.h>

using namespace std;

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

unordered_map<int,int>a;
int n;

int main()
{
    in >> n;
    for (int i = 1; i <= n; i++)
    {
        int x,y;
        in >> x >> y;
        if (x == 1)
            a.insert({y,y});
        else if (x == 2)
            a.erase(y);
        else if (x == 3)
            out << a.count(y) << '\n';
    }
    return 0;
}