Cod sursa(job #2741046)

Utilizator Uriesu_IuliusUriesu Iulius Uriesu_Iulius Data 15 aprilie 2021 13:29:29
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <bits/stdc++.h>

using namespace std;

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

int n;
map<int, bool> m;

int main()
{
    int i, x, op;
    fin >> n;
    for(i=1; i<=n; i++)
    {
        fin >> op >> x;
        if(op==1)
            m[x]=1;
        else if(op==2)
            m.erase(x);
        else
            fout << m.count(x) << '\n';
    }
    return 0;
}