Cod sursa(job #2588564)

Utilizator k2e0e0w3qDumitrescu Gheorghe k2e0e0w3q Data 24 martie 2020 22:39:51
Problema Hashuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.53 kb
#include <bits/stdc++.h>
using namespace std;

set <int> G;
int main () {
    ifstream fin ("hashuri.in");
    ofstream fout ("hashuri.out");
    ios::sync_with_stdio(false);

    int n, key, x;
    cin >> n;
    for (; n; n--) {
        cin >> key >> x;
        switch (key) {
        case 1:
            G.insert(x);
            break;
        case 2:
            G.erase(x);
            break;
        case 3:
            cout << (G.find(x) != G.end()) << '\n';
            break;
        }
    }
    return 0;
}