Cod sursa(job #2391300)
Utilizator | Data | 28 martie 2019 19:05:27 | |
---|---|---|---|
Problema | Heapuri | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
long long nn,a,b,i,j;
map<long long,long long>m,n;
int main()
{
fin>>nn;j=1;
for(i=0;i<nn;i++)
{
fin>>a;
if(a==1) {
fin>>b;
m[j]=b;j++;
n[b]=1;
}
else if(a==2) {
fin>>b;
n.erase(m[b]);
}
else if(a==3) {
cout<<n.begin()->first<<endl;
}
}
return 0;
}