Cod sursa(job #2549518)

Utilizator gabbie02Thomits Gabriel gabbie02 Data 17 februarie 2020 19:15:49
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.58 kb
#include <fstream>
#include <set>

using namespace std;

ifstream fin("hashuri.in");
ofstream fout("hashuri.out");

int main()
{
    set<unsigned int> elem;
    unsigned int n, x;
    char op;
    fin >> n;
    while(n){
        fin >> op >> x;
        switch(op){
            case '1':
                elem.insert(x);
                break;
            case '2':
                elem.erase(x);
                break;
            case '3':
                fout << (elem.find(x) != elem.end()) << '\n';
                break;
        }
        n--;
    }
    return 0;
}