Pagini recente » Atasamentele paginii Clasament oji_go_10_3 | Cod sursa (job #2760950) | Istoria paginii runda/training_day_8./clasament | Cod sursa (job #2897524) | Cod sursa (job #2753767)
#include <fstream>
#include <vector>
#include <set>
using namespace std;
int n, x, y;
vector <int> v;
set <int> heap;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int main()
{
f>>n;
while (n>0)
{
f>>x;
if(x==1)
{
f>>y;
heap.insert(y);
v.push_back(y);
}
else if(x==2)
{
f>>y;
heap.erase(v[y-1]);
}
else
{
g<<*heap.begin()<<endl;
}
n--;
}
return 0;
}