Cod sursa(job #2923036)

Utilizator proflaurianPanaete Adrian proflaurian Data 11 septembrie 2022 11:46:17
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 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(int i=1;i<=n;i++)
    {
        f>>t>>x;
        if(t==1)
            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;
}