Pagini recente » Cod sursa (job #1350034) | Diferente pentru problema/maxcost intre reviziile 1 si 2 | Cod sursa (job #2881456) | Cod sursa (job #1470775) | Cod sursa (job #2033323)
#include<fstream>
#include<set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int nr, n, x, q, m[200002];
multiset<int> heap;
int main()
{
f>>nr;
while(nr>0)
{
f>>q;
if(q==1)
{
f>>x;
heap.insert(x);
m[++n]=x;
}
if(q==2)
{
f>>x;
heap.erase(heap.find(m[x]));
}
if(q==3)
g<<*heap.begin()<<"\n";
nr--;
}
return 0;
}