Cod sursa(job #1845661)
Utilizator | Data | 11 ianuarie 2017 19:24:26 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include<fstream>
#include<set>
using namespace std;
set<int>a;
long long n,x,k,i,type,v[100005];
int main()
{
ifstream f("heapuri.in");
ofstream g("heapuri.out");
f>>n;
for(i=1;i<=n;i++)
{
f>>type;
if(type==1)
{
f>>x;
a.insert(x);
v[++k]=x;
}
else if(type==2)
{
f>>x;
a.erase(v[x]);
}
else g<<*a.begin()<<'\n';
}
return 0;
}