Cod sursa(job #1307241)

Utilizator gabrieligabrieli gabrieli Data 1 ianuarie 2015 18:35:16
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.41 kb
#include <fstream>
#include <unordered_set>
using namespace std;

int main() {
    ifstream fin("hashuri.in");
    ofstream fout("hashuri.out");
    
    int t; fin >> t;
    unordered_set<int> h;
        
    for (int op, x; fin >> op >> x;) {
        if (op == 1)
            h.insert(x);
        else if (op == 2)
            h.erase(x);
        else
            fout << h.count(x) << '\n';
    }

    return 0;
}