Cod sursa(job #1218368)

Utilizator rangerChihai Mihai ranger Data 10 august 2014 18:36:46
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.4 kb
#include<fstream>
#include<set>
using namespace std;

ifstream cin("hashuri.in");
ofstream cout("hashuri.out");

int n,type,x;
set<int> s;

int main()
{
    cin>>n;
    while (n--)
    {
        cin>>type>>x;
        if (type==1)
            s.insert(x);
        if (type==2)
            s.erase(x);
        if (type==3)
           cout<<(s.find(x)!=s.end())<<"\n";
    }
    return 0;
}