Cod sursa(job #823134)
| Utilizator | Data | 24 noiembrie 2012 17:40:31 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.64 kb |
#include <cstdio>
#define oo 1000000005
#define MaxN = 200005;
using namespace std;
int N,V[MaxN],X,Type;
int Minim()
{
int i,Min=oo;
for(i=1;i<=N;i++)
if (V[i]<Min)
Min=V[i];
return Min;
}
int main()
{
freopen("heapuri.in", "r", stdin);
freopen("heapuri.out", "w", stdout);
int M; scanf("%d", &M);
for (; M; --M) {
scanf("%d", &Type);
if (Type == 1) {
scanf("%d", &V[++N]);
}
if (Type == 2) {
scanf("%d", &X);
V[X]=oo;
}
if (Type == 3)
printf("%d\n", Minim());
}
return 0;
}
