Pagini recente » Cod sursa (job #3362224) | Cod sursa (job #3362365) | Cod sursa (job #3362363) | Cod sursa (job #3362223) | Cod sursa (job #3363482)
#include<bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int t;
set<int> s;
vector<int> v;
int main(){
fin >> t;
while(t--){
int tip; fin >> tip;
if(tip == 1){
int x; fin >> x;
v.push_back(x);
s.insert(x);
}
else if(tip == 2){
int poz; fin >> poz;
s.erase(v[poz - 1]);
}
else{
int rez;
for(auto i : s){
rez = i;
break;
}
fout << rez << '\n';
}
}
}