Cod sursa(job #1040658)

Utilizator PsychoAlexAlexandru Buicescu PsychoAlex Data 24 noiembrie 2013 19:11:07
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.62 kb
#include <iostream>
#include <unordered_map>
#include <algorithm>
#include <fstream>

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

int n;
std::unordered_map<int, bool> hashu;

void citire()
{
    int x, y;
    fin>>n;
    for(int i = 0; i < n; i++)
    {
        fin>>x>>y;
        if(x == 1)
        {
            hashu[y] = 1;
        }
        else
            if(x == 2)
            {
                hashu[y] = 0;
            }
            else
            {
                fout<<hashu[y]<<'\n';
            }
    }
}

int main()
{
    citire();
    return 0;
}