Cod sursa(job #2895381)

Utilizator Iordache_AnaIordache Ana-Georgiana Iordache_Ana Data 29 aprilie 2022 00:58:55
Problema Heapuri Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.72 kb
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set <int> sett;
int x, N, index, operatie, v[200001], poz = 0;
int main()
{
    f>>N;
    for(index=1; index<=N; index++)
    {
        f>>operatie;
        if(operatie == 1)
        {
            f>>x;
            sett.insert(x);
            poz++;
            v[poz] = x;

        }
        else
        {
            if(op == 2)
            {
                f>>x;
                sett.erase(v[x]);
            }
            else
            {

                g<<*sett.begin()<<'\n';
            }
        }

    }

    f.close();
    g.close();
    return 0;
}