Cod sursa(job #2708556)

Utilizator AACthAirinei Andrei Cristian AACth Data 18 februarie 2021 21:34:30
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.76 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
//#define int long long
const int Max = 1e5 + 1;
void nos()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}
int n;
unordered_set < int > who;
void read()
{
    f>>n;
}
void solve()
{
    int i;
    for(i=1;i<=n;i++)
    {
        int task;
        int element;
        f>>task>>element;
        if(task == 1)
            who.insert(element);
        if(task == 2)
            who.erase(element);
        if(task == 3)
        {
            g<<(who.find(element)!=who.end())<<'\n';
        }
    }
}
void restart()
{

}

int32_t main()
{
    nos();

        read();
        solve();
        restart();

    return 0;
}