Pagini recente » Cod sursa (job #2362979) | Istoria paginii utilizator/stoianrares | Cod sursa (job #320468) | Cod sursa (job #2134549) | Cod sursa (job #2169386)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
const int nmax = 200002;
int n,x,y;
int v[nmax];
set < int > H;
int main()
{
int contor=0;
fin >> n;
while(n--) {
fin >> x;
if(x==1) {
fin >> v[++contor];
H.insert(v[contor]);
} else
if(x==2) {
fin >> y;
H.erase(v[y]);
} else fout << *H.begin() << "\n";
}
return 0;
}