Cod sursa(job #2743578)

Utilizator wildcolaSTEFAN PLACINTESCU wildcola Data 23 aprilie 2021 11:55:00
Problema Hashuri Scor 30
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ifstream f("hashuri.in");
    ofstream g("hashuri.out");
    unordered_map<int, bool> m;
    int n;
    f>>n;
    for(short i=1; i<=n; ++i)
    {
        int com, x;
        f>>com>>x;
        if(com==1)
            m[x]=1;
        else
            if(com == 2)
                m.erase(x);
            else
                if(m.find(x) == m.end())
                    g<<0<<"\n";
                else
                    g<<1<<"\n";

    }
    return 0;
}