Cod sursa(job #1423509)

Utilizator greenadexIulia Harasim greenadex Data 21 aprilie 2015 22:02:40
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.5 kb
#include <fstream>
#include <unordered_map>
using namespace std;

unordered_map<int, int> smth;

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

int main()
{
    int N;
    fin >> N;
    for (int op, x; N; N--){
        fin >> op >> x;
        if (op == 1)
            if(!smth.count(x))
                smth[x] = 1;
        if (op == 2)
            if(!smth.count(x))
                smth[x] = 0;
        if (op == 3)
            fout << smth[x];
    }
    return 0;
}