Cod sursa(job #2608282)

Utilizator bmc213Mihai Cosmin bmc213 Data 30 aprilie 2020 22:23:06
Problema Heapuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <bits/stdc++.h>

using namespace std;

ifstream f("heapuri.in");
ofstream g("heapuri.out");

set <int> v;
int a[200005], q, t, x, k;

int main()
{
    f >> q;
    for(; q; q --)
    {
        f >> t;
        if(t == 1)
        {
            f >> x;
            v.insert(x);
            a[++ k] = x;
        }
        else if(t == 2)
        {
            f >> x;
            v.erase(a[x]);
        }
        else
            g << *v.begin() < "\n";
    }

    return 0;
}