Cod sursa(job #2748412)
Utilizator | Data | 30 aprilie 2021 17:16:34 | |
---|---|---|---|
Problema | Heapuri | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include<set>
#include<fstream>
using namespace std;
int n,k,x,y;
int l[100000];
set<int> V;
int main()
{ifstream f("heapuri.in");
ofstream g("heapuri.out");
f>>n;
for(int i=1;i<=n;++i)
{f>>x;
if(x==1)
{f>>y;
l[++k]=y;
V.insert(y);}
if(x==2)
{f>>y;
V.erase(l[y]);}
if(x==3)
g<<*V.begin()<<endl;}}