Cod sursa(job #2922797)

Utilizator andreidjManastireanu Andrei-Eduard andreidj Data 10 septembrie 2022 10:02:05
Problema Hashuri Scor 0
Compilator cpp-32 Status done
Runda Arhiva educationala Marime 0.44 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set<int> s;
int n, t, x;
int main()
{
    f>>n;
    for(;n;n--)
    {
        f>>t>>x;
        if(t==1)
        {
            f>>x;
            s.insert(x);
        }
        else if(t==2)
        s.erase(x);
        else if(s.find(x)==s.end())
            g<<"0\n";
        else
            g<<"1\n";
    }
    return 0;
}