Cod sursa(job #2048211)

Utilizator zanugMatyas Gergely zanug Data 25 octombrie 2017 20:28:17
Problema Hashuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.54 kb
#include <iostream>
#include <fstream>
#include <unordered_map>

using namespace std;

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

int n,;
unordered_map <int, bool> m;

int main()
{
    ios::sync_with_stdio(false);

    fin >> n;

    while(n--)
    {
        int v, x;
        fin >> v >> x;

        if(v == 1)
            m[x] = 1;
        else if(v == 2)
            m.erase(x);///m[x] = 0;
        else
            fout << (m.find(x) != m.end()) << "\n";///fout << m[x];
    }


    return 0;
}