Cod sursa(job #2577034)

Utilizator cristian51090Oanta Cristian cristian51090 Data 8 martie 2020 01:24:12
Problema Hashuri Scor 70
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.49 kb
#include <bits/stdc++.h>
using namespace std;
map<int,int> x;
ifstream fin("hashuri.in");
ofstream fout("hashuri.out");
int main()
{
    int n,i,j,l;
    fin>>n;
    for(l=1;l<=n;l++){
        fin>>i>>j;
        if(i==1){
            x.insert(x.begin(),{j,1});
        }
        else if(i==2){
            x.erase(j);
        }
        else{
            if(x.find(j)!=x.end())
                fout << "1\n";
            else fout << "0\n";
        }
    }
    return 0;
}