Cod sursa(job #3136052)

Utilizator proflaurianPanaete Adrian proflaurian Data 5 iunie 2023 12:24:30
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.45 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
unordered_set<int> S;
int n,tip,x;
int main()
{
    f>>n;
    for(;n;n--)/// de T ori
    {
        f>>tip>>x;
        if(tip==1)
            S.insert(x);
        else if(tip==2)
            S.erase(x);
        else
            if(S.find(x)==S.end())
                g<<"0\n";
            else
                g<<"1\n";
    }
    return 0;
}