Pagini recente » Cod sursa (job #1130094) | Cod sursa (job #1791150) | Cod sursa (job #711126) | Cod sursa (job #1583289) | Cod sursa (job #2896403)
#include<set>
#include<fstream>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int main()
{
int n,optiune,x,val[200001],j=1;
multiset<int> myset;
f>>n;
for(int i=1;i<=n;i++)
{f>>optiune;
if(optiune==1)
{
f>>x;
myset.insert(x);
val[j]=x;
j++;
}
if(optiune==2)
{
f>>x;
myset.erase(val[x]);
}
if(optiune==3)
{
g<<*myset.begin()<<'\n';
}
}
}