Pagini recente » Cod sursa (job #1528560) | Cod sursa (job #712312) | Cod sursa (job #2566766) | Cod sursa (job #24706) | Cod sursa (job #1379941)
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int m, tip, x, ord[MAXN], cnt;
set <int> heap;
int main()
{
fin >> m;
for (; m; --m)
{
fin >> tip;
if (tip == 3) fout << *heap.begin() << '\n';
else
{
fin >> x;
if (tip == 1)
{
heap.insert(x);
ord[++cnt] = x;
}
else
{
heap.erase(heap.find(ord[x]));
}
}
}
return 0;
}