Cod sursa(job #2640804)

Utilizator Iustin01Isciuc Iustin - Constantin Iustin01 Data 8 august 2020 13:04:31
Problema Hashuri Scor 20
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.42 kb
#include <bits/stdc++.h>
using namespace std;

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

int n, cnt, x, tip;
map < int , int > m;

int main(){
    in>>n;
    for(int i = 1; i <= n; i++){
        in>>tip>>x;
        if(tip == 1 && m.find(x) == m.end())
            m[x] = ++cnt;
        else if(tip == 2)
            m.erase(x);
        else
            out<<(m.find(x) != m.end())<<"\n";
    }
}