Cod sursa(job #2743572)

Utilizator TonioAntonio Falcescu Tonio Data 23 aprilie 2021 11:41:27
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.48 kb
#include <bits/stdc++.h>

using namespace std;

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

map <int, int> table;

int main()
{
int n, tip, x;
in >> n;
for(int i = 0; i < n; ++i)
{
    in >> tip >> x;
    if(tip == 1 and table.find(x) == table.end())
    {
        table[x] = 1;
    }
    else if(tip == 2)
    {
        table.erase(x);
    }
    else if(tip == 3)
    {
        out << (table.find(x) != table.end()) << "\n";
    }
}

    return 0;
}