Cod sursa(job #2911789)

Utilizator _andrei4567Stan Andrei _andrei4567 Data 2 iulie 2022 02:35:32
Problema Heapuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.48 kb
#include <fstream>
#include <vector>
#include <set>

using namespace std;

ifstream cin ("heapuri.in");
ofstream cout ("heapuri.out");

multiset <int> s;

vector <int> v;

int n, op, x;

int main()
{
    for (cin >> n; n; --n)
    {
        cin >> op;
        if (op == 1)
            cin >> x, v.push_back(x), s.insert(x);
        else if (op == 2)
            cin >> x, s.erase(v[x - 1]);
        else
            cout << *s.begin() << '\n';
    }
    return 0;
}