Cod sursa(job #2922806)

Utilizator andreidjManastireanu Andrei-Eduard andreidj Data 10 septembrie 2022 10:12:17
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
unordered_set <int> s;
int n, t, x;
int main()
{
    fin>>n;
    for(;n;n--)
    {
        fin>>t>>x;
        if(t==1)
        {

            s.insert(x);
        }
        else if(t==2)
        {
            s.erase(x);
        }
        else if(s.find(x)==s.end())
            fout << "0" << "\n";
        else
            fout << "1" << "\n";

    }
    return 0;
}