Cod sursa(job #2904838)

Utilizator andreiiorgulescuandrei iorgulescu andreiiorgulescu Data 18 mai 2022 09:50:38
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.46 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 and a.count(y) == 0)
            a.insert({y,y});
        else if (x == 2)
            a.erase(y);
        else if (x == 3)
            out << a.count(y) << '\n';
    }
    return 0;
}