Cod sursa(job #1068595)
| Utilizator | Data | 28 decembrie 2013 15:26:47 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.62 kb |
#include <iostream>
#include <set>
using namespace std;
#define NMAX 200001
int main()
{
set<int> my_set;
int aux_set[NMAX];
int poz = 0;
int N;
freopen("heapuri.in", "r", stdin);
freopen("heapuri.out", "w", stdout);
cin >> N;
for(int i = 0; i < N; ++i)
{
int op;
cin >> op;
if(op == 1)
{
int x;
cin >> x;
my_set.insert(x);
aux_set[++poz] = x;
}
else if(op == 2)
{
int x;
cin >> x;
my_set.erase(aux_set[x]);
}
else
{
set <int>::iterator it = my_set.begin();
cout << *it << endl;
}
}
return 0;
}
