Pagini recente » Cod sursa (job #1932926) | Cod sursa (job #1765408) | Cod sursa (job #955201) | Cod sursa (job #2500795) | Cod sursa (job #2906480)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream fin ("heapuri.in");
ofstream fout("heapuri.out");
set<int> h;
int n,x,v[200016],poz,y;
int main()
{
fin>>n;
for(int i=1;i<=n;i++)
{
fin>>x;
if(x==1)
{
fin>>y;
h.insert(y);
v[++poz]=y;
}
else if(x==2)
{
fin>>y;
h.erase(v[y]);
}
else if(x==3)
{
fout<<*h.begin()<<"\n";
}
}
return 0;
}