Cod sursa(job #1472261)

Utilizator CiobaCatalinCioba Catalin CiobaCatalin Data 16 august 2015 19:46:55
Problema Hashuri Scor 60
Compilator cpp Status done
Runda Arhiva educationala Marime 0.63 kb
#include <iostream>
#include <map>
#include <fstream>

using namespace std;

map<long long, bool> m;
int n, type;
long long tmp;

int main()
{
    ifstream in("hashuri.in");
    ofstream out("hashuri.out");

    in >> n;
    for (int i = 0; i < n; ++i) {
        in >> type >> tmp;
        if (type == 1) {
            m[tmp] = true;
        }
        if (type == 2) {
            m[tmp] = false;
        }
        if (type == 3) {
            if (m[tmp])
                out << 1 << endl;
            else
                out << 0 << endl;
        }
    }

    in.close();
    out.close();
    return 0;
}