Cod sursa(job #398285)

Utilizator MKLOLDragos Ristache MKLOL Data 18 februarie 2010 13:25:13
Problema Heapuri Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.41 kb
#include<fstream.h>
#include<set>
using namespace std;
int N,K,x,y;
int l[201000];
set<int> V;
int main()
{
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
fin>>N;
    for(int i=1;i<=N;++i)
    {
    fin>>x;
    if(x==1)
    {

    fin>>y;
    l[++K]=y;
    V.insert(y);
    }
    if(x==2)
    {
    fin>>y;
    V.erase(l[y]);
    }
    if(x==3)
    fout<<*V.begin()<<"\n";
    }
}