Pagini recente » Cod sursa (job #2892351) | Cod sursa (job #509341) | Cod sursa (job #1482179) | Cod sursa (job #1571451) | Cod sursa (job #2327278)
#include <bits/stdc++.h>
using namespace std;
ifstream f ("heapuri.in");
ofstream g ("heapuri.out");
set <int> h;
const int nmax=2e5+3;
int nr,n,caz,x,v[nmax];
int main()
{
ios::sync_with_stdio(false);
f>>n;
for(int i=1;i<=n;++i)
{
f>>caz;
if(caz==1)
{
f>>x;
v[++nr]=x;
h.insert(x);
}
else if(caz==2)
{
f>>x;
h.erase(v[x]);
}
else g<<*h.begin()<<'\n';
}
return 0;
}