Pagini recente » Cod sursa (job #1587225) | Istoria paginii info-oltenia-2018/echipe/7-8 | Cod sursa (job #2746443) | Cod sursa (job #2051864) | Cod sursa (job #2741189)
#include <bits/stdc++.h>
using namespace std;
ifstream F ("heapuri.in");
ofstream G ("heapuri.out");
set <int> heap;
int main()
{
int n, op, ord[10001], x, k = 0;
F>>n;
for(int i = 0; i < n; i++)
{
F>>op;
if(op == 1)
{
F>>x;
k++;
ord[k] = x;
heap.insert(x);
}
if(op == 2)
{
F>>x;
heap.erase(ord[x]);
}
else if (op == 3)
G<<*heap.begin();
}
}