Pagini recente » Cod sursa (job #1942048) | Cod sursa (job #2191457) | Cod sursa (job #997671) | Cod sursa (job #296165) | Cod sursa (job #1608499)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
const int NMax = 2e5 + 5;
int Pos[NMax];
set < int > Set;
int main(){
int n, c, x, k;
fin >> n;
k = 0;
while(n--){
fin >> c;
if(c == 1){
fin >> x;
Pos[++k] = x;
Set.insert(x);
} else {
if(c == 2){
fin >> x;
Set.erase(Set.find(Pos[x]));
} else {
fout << *Set.begin() << "\n";
}
}
}
return 0;
}