Cod sursa(job #2949193)

Utilizator stefan24Sandor Stefan stefan24 Data 30 noiembrie 2022 10:05:36
Problema Hashuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.36 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");

set<int>m;

int main()
{
    int n;
    f>>n;
    for(int i=1;i<=n;++i)
    {
        int cer,x;f>>cer>>x;
        if(cer==1)m.emplace(x);
        if(cer==2)m.erase(x);
        if(cer==3)if(m.find(x)!=m.end())g<<"1\n";
        else g<<"0\n";
    }
}