Pagini recente » Atasamentele paginii vacanta_11_3 | Cod sursa (job #3204144) | Cod sursa (job #1732953) | Cod sursa (job #2520614) | Cod sursa (job #3259733)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
multiset<int> M;
unordered_map<int , int> O;
int n , op;
int main()
{
int i , x , j = 0;
fin >> n;
for(i = 1;i <= n;i++)
{
fin >> op;
if(op == 1)
{
fin >> x;
M.insert(x);
j++;
O[j] = x;
}
if(op == 3) fout << *(M.begin()) << "\n";
if(op == 2)
{
fin >> x;
x = O[x];
M.erase(M.find(x));
}
}
return 0;
}