Cod sursa(job #1412797)

Utilizator BLz0rDospra Cristian BLz0r Data 1 aprilie 2015 15:50:47
Problema Hashuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.51 kb
#include <fstream>
#include <tr1/unordered_set>

using namespace std;
using namespace tr1;

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

unordered_set <int> h;

int main(  ) {
    int n;
    fin >> n;
    for ( int i = 1; i <= n; ++ i ) {
        int x, y;
        fin >> x >> y;
        if ( x == 1 ) {
            h.insert(y);
        } else if ( x== 2 ) {
            h.erase(y);
        } else {
            fout << (h.find(y)!=h.end()) << "\n";
        }
    }

    return 0;
}