Pagini recente » Cod sursa (job #301126) | Cod sursa (job #2447138) | Statistici Popescu Ioana Diana (diana99ro) | Cod sursa (job #1672204) | Cod sursa (job #398284)
Cod sursa(job #398284)
#include<fstream.h>
#include<set>
using namespace std;
int N,K,x,y;
int l[201000];
set<int> V;
int main()
{
ifstream fin("heapuri.in");
ofstream fout("hepuri.out");
fin>>N;
for(int i=1;i<=N;++i)
{
fin>>x;
if(x==1)
{
fin>>y;
l[++K]=y;
V.insert(y);
}
if(x==2)
{
fin>>y;
V.erase(l[y]);
}
if(x==3)
fout<<*V.begin()<<"\n";
}
}