Cod sursa(job #2588741)

Utilizator KillHorizon23Orban Robert KillHorizon23 Data 25 martie 2020 13:22:48
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <bits/stdc++.h>
using namespace std;

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

map < int , int > v;

int main()
{
    int t, op, x;
    fin >> t;
    while (t--)
    {
        fin >> op >> x;
        if (op != 3)
        {
            if (op == 1)
                v[x] = 1;
            else if (op == 2)
                v.erase(x);
        }
        else
            if (v[x] == 1)
                fout << 1 << "\n";
            else fout << 0 << "\n";
    }
}