Pagini recente » Statistici Stanciu Cristian (crististanciu15) | Monitorul de evaluare | Istoria paginii utilizator/bestkid1234 | Istoria paginii utilizator/melaniaion | Cod sursa (job #2893151)
#include <bits/stdc++.h>
using namespace std;
ifstream f ("heapuri.in");
ofstream g ("heapuri.out");
vector <int> m;
int ord[200000];
int n;
int main()
{
int k=0,cod,x;
f>>n;
for (int i=0;i<n;++i)
{
f>>cod;
if (cod==1)
{
f>>x;
ord[++k]=x;
m.push_back(x);
}
else if (cod==2)
{
f>>x;
m.erase(find(m.begin(),m.end(),ord[x]));
}
else
{
g<<*min_element(m.begin(),m.end())<<'\n';
}
}
return 0;
}