Pagini recente » Cod sursa (job #807344) | Statistici Robert Burbulea (RobertBurbulea) | Cod sursa (job #30535) | Borderou de evaluare (job #1575059) | Cod sursa (job #3131876)
#include <fstream>
#include <set>
using namespace std;
int n , t, x , copyt;
multiset<int> heap;
int v[2000001];
int main(){
ifstream f("heapuri.in");
ofstream g("heapuri.out");
f>>n;
while(n-->0){
f>>t;
if(t==1) f>>x, heap.insert(x), v[++copyt]=x;
if(t==2) f>>x, heap.erase(v[x]);
if(t==3) g<<*heap.begin()<<"\n";
}
return 0;
}