Cod sursa(job #2228572)
| Utilizator | Data | 4 august 2018 12:01:49 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
freopen("heapuri.in","r",stdin);
freopen("heapuri.out","w",stdout);
int q;
set<int>s;
vector<int>v;
cin>>q;
while(q--) {
int tip;
cin>>tip;
if(tip==1) {
int foo;
cin>>foo;
s.insert(foo);
v.push_back(foo);
}
if(tip==2) {
int foo;
cin>>foo;
s.erase(v[foo-1]);
}
if(tip==3) {
cout<<*s.begin()<<"\n";
}
}
return 0;
}
