Cod sursa(job #2893151)

Utilizator catarau.bianca.Bianca Catarau catarau.bianca. Data 25 aprilie 2022 12:45:41
Problema Heapuri Scor 40
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.59 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f ("heapuri.in");
ofstream g ("heapuri.out");
vector <int> m;
int ord[200000];
int n;
int main()
{
 
    int k=0,cod,x;
 
    f>>n;
    for (int i=0;i<n;++i)
    {
        f>>cod;
        if (cod==1)
        {
            f>>x;
            ord[++k]=x;
            m.push_back(x);
        }
        else if (cod==2)
        {
            f>>x;
            m.erase(find(m.begin(),m.end(),ord[x]));
        }
        else
        {
            g<<*min_element(m.begin(),m.end())<<'\n';
        }
 
    }
    return 0;
}