Pagini recente » Diferente pentru problema/logic intre reviziile 89 si 44 | Cod sursa (job #3223074) | Statistici tenis paleta (Tenis_paleta) | Cod sursa (job #370306) | Cod sursa (job #2893168)
#include <bits/stdc++.h>
using namespace std;
ifstream f ("heapuri.in");
ofstream g ("heapuri.out");
set <int> h;
int ord[200001], n, o, op, a;
int main()
{
f>>n;
for ( int i = 1; i <= n; i++ )
{
f>>op;
if ( op==1 )
{
f>>a;
h.insert(a);
o++;
ord[o]=a;
}
else if (op==2)
{
f>>a;
h.erase(ord[a]);
}
else
{
g<<*min_element(h.begin(), h.end());
g<<"\n";
}
}
return 0;
}