Cod sursa(job #2253206)

Utilizator rnqftwcalina florin daniel rnqftw Data 3 octombrie 2018 19:23:03
Problema Hashuri Scor 70
Compilator cpp Status done
Runda Arhiva educationala Marime 0.47 kb
#include<bits/stdc++.h>

using namespace std;

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

map<int,int> m ;

int main(){
    int n , tip , x ;
    in >> n ;
    while(n--){
        in >> tip >> x ;
        if(tip == 1 ){
            m[x]++;
            continue;
        }
        if(tip == 2)
        {
            m.erase(x);
            continue;

        }
        int z =  (m.find(x) != m.end());
        out << z << '\n';
    }
}