Pagini recente » Cod sursa (job #3038492) | Cod sursa (job #3264243) | Cod sursa (job #2831802) | Rating Volosciuc Edmond Roland (volosciucedmond) | Cod sursa (job #3277522)
#include <bits/stdc++.h>
#define cin ci
#define cout co
using namespace std;
ifstream cin("heapuri.in");
ofstream cout("heapuri.out");
vector<int> v;
multiset<int> heap;
int n, c, x;
int main()
{
cin >> n;
while(n--)
{
cin >> c;
if(c == 1)
{
cin >> x;
heap.insert(x);
v.push_back(x);
}
else
if(c == 3)
{
cout << *heap.begin() << '\n';;
}
else
{
cin >> x;
heap.erase(v[x - 1]);
}
}
return 0;
}