Pagini recente » Istoria paginii utilizator/silvialutsch | Profil AdyCiubotaru | Cod sursa (job #658846) | Monitorul de evaluare | Cod sursa (job #2893167)
#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(find(h.begin(),h.end(),ord[a]));
}
else
{
g<<*min_element(h.begin(), h.end());
g<<"\n";
}
}
return 0;
}