Pagini recente » Cod sursa (job #2154137) | Cod sursa (job #1026719) | Cod sursa (job #1130583) | Cod sursa (job #831315) | Cod sursa (job #2895376)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set <int> sett;
int x, N, index, operatie, v[200001],pozitie= 0;
int main()
{
f>>N;
for(index=1; index<=N; index++)
{
f>>operatie;
if(operatie == 1)
{
f>>x;
sett.insert(x);
v[++pozitie] = x;
}
else
if(operatie == 2)
{
f>>x;
sett.erase(v[x]);
}
else
g<<*sett.begin()<<endl;
}
f.close();
g.close();
return 0;
}