Cod sursa(job #2745662)

Utilizator GhiuzanuEdward Ghiuzan Ghiuzanu Data 26 aprilie 2021 21:13:55
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>

using namespace std;

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

unordered_map<int, int> h;
int n,c;
long long x;

int main()

{
    in>>n;
    for(int i=1;i<=n;i++)
    {

        in>>c>>x;

        if(c == 1)
        { h[x]=1; }
        else if(c == 2)
        {  h.erase(x); }
        else if(c == 3)
        {

            if(h.find(x) != h.end())
                out<<1<<'\n';

            else
                out<<0<<'\n';

        }}

    return 0;

}