Cod sursa(job #1953024)

Utilizator teodorgTeodor G teodorg Data 4 aprilie 2017 16:29:01
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.46 kb
#include <bits/stdc++.h>

using namespace std;
ifstream f("hashuri.in");
ofstream g("hashuri.out");
set<int> s;
int n,i,op,x;

int main()
{
    f>>n;
    for(i=1;i<=n;i++)
    {
        f>>op>>x;
        if(op==1)
            s.insert(x);
        else
            if(op==2)
                s.erase(x);
        else
            if(s.find(x)==s.end())
                g<<"0\n";
            else
                g<<"1\n";
    }
    return 0;
}