Cod sursa(job #2619373)
| Utilizator | Data | 27 mai 2020 16:03:32 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.47 kb |
#include<bits/stdc++.h>
#include <fstream>
#include <set>
#define Nmax 200001
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int n,v[Nmax],nr;
set <int> heap;
int main()
{
int a,b;
f>>n;
for (int i=1;i<=n;i++)
{
f>>a;
if (a==1)
f>>b,v[++nr]=b,heap.insert(b);
if (a==2)
f>>b,heap.erase(v[b]);
if (a==3)
g<<*heap.begin()<<'\n';
}
return 0;
}
