Cod sursa(job #3363487)

Utilizator Cyb3rBoltSbora Ioan-David Cyb3rBolt Data 18 august 2026 16:10:44
Problema Heapuri Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.5 kb
#include <bits/stdc++.h>

using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int curent = 0, v[200003];
set<int> st;

int main()
{
    int tt; fin >> tt;
    while(tt--) {
        int tip; fin >> tip;
        if(tip == 1) {
            fin >> v[++curent];
            st.insert(v[curent]);
        }
        else if(tip == 2) {
            int x; fin >> x;
            st.erase(v[x]);
        }
        else fout << *st.begin() << '\n';
    }

    return 0;
}