Pagini recente » Cod sursa (job #2520529) | Cod sursa (job #2772017) | Cod sursa (job #319057) | Cod sursa (job #1642399) | Cod sursa (job #2222338)
#include <bits/stdc++.h>
using namespace std;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
set <int> h;
int v[200005];
int main()
{
int n;
in >> n;
int poz = 0;
for(int i = 1; i <= n; i++)
{
int c;
in >> c;
if(c == 1)
{
poz ++;
in >> v[poz];
h.insert(v[poz]);
}
else if(c == 2)
{
int x;
in >> x;
h.erase(v[x]);
}
else
out << *h.begin() << '\n';
}
return 0;
}