Cod sursa(job #2616133)

Utilizator srazvan100@gmail.comRazvan Alexandru Sandu [email protected] Data 16 mai 2020 19:54:09
Problema Hashuri Scor 60
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.54 kb
#include <bits/stdc++.h>
using namespace std;

int main() {
    ifstream fin("hashuri.in", ios::in);
    ofstream fout("hashuri.out", ios::out);
    int n;
    fin >> n;
    set<int> s;
    int t, value;
    while (n--) {
        fin >> t;
        fin >> value;
        switch (t) {
            case 1:
                s.insert(value);
                break;
            case 2:
                s.erase(value);
                break;
            case 3:
                fout << to_string(s.find(value) != s.end() ? 1 : 0) << endl;
        }
    }
}