Pagini recente » Monitorul de evaluare | Statistici Georgia Jacobs (6audreyc2691wh0) | Istoria paginii monthly-2012/runda-9/probleme | Istoria paginii utilizator/mateizainea | Cod sursa (job #1293896)
#include <fstream>
#include <set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set <int>h;
int n,x,k,y,a[200001];
int main()
{
f>>n;
for(int i=1;i<=n;i++)
{
f>>x;
if(x==1)
{
f>>y;
h.insert(y);
a[++k]=y;
}
else if(x==2)
{
f>>y;
h.erase(a[y]);
}
else
g<<*h.begin()<<'\n';
}
return 0;
}