Pagini recente » Monitorul de evaluare | Rating Bucur Vlad Andrei (vladdy47) | Cod sursa (job #1721752) | Cod sursa (job #2023357) | Cod sursa (job #1315431)
#include <fstream>
#include <set>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
multiset<int> heap;
int n, x, y, V[100010], i;
int main()
{
fin >> n;
int poz = 1;
for(i = 1; i <= n;i ++)
{
fin >> x;
if(x == 1)
{
fin >> y;
heap.insert(y);
V[poz] = y;
poz ++;
}
else
if(x == 2)
{
fin >> y;
heap.erase(V[y]);
}
else
fout << *heap.begin() << '\n';
}
return 0;
}