Pagini recente » Cod sursa (job #3261198) | Cod sursa (job #822234) | Diferente pentru problema/submat intre reviziile 6 si 7 | Cod sursa (job #1096240) | Cod sursa (job #2746825)
#include<bits/stdc++.h>
using namespace std;
set<int>v;
vector<int> ord;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
int main() {
int n,x,com;
in>>n;
for(int i=0;i<n;++i){
in>>com;
if(com==1){
in>> x;
v.insert(x);
ord.push_back(x);
}
if(com==2){
in>>x;
v.erase(ord[x-1]);
}
if(com==3){
out<<*v.begin()<<"\n";
}
}
return 0;
}