Cod sursa(job #3042264)

Utilizator radu._.21Radu Pelea radu._.21 Data 5 aprilie 2023 04:35:51
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <fstream>
#include <map>


using namespace std;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
map<int,int>M;
int main(){
    int n;
    fin>>n;
    while(n--){
        int cer,x; fin>>cer>>x;
        if(cer==1){
            /// adaug x la multime
            if(M.find(x)==M.end())
                M[x]=1;

        }
        else if(cer==2){
            M.erase(x);
        }
        else{
            fout<<M[x]<<'\n';
        }

    }

    return 0;
}