Cod sursa(job #3369330)
| Utilizator | Data | 19 octombrie 2026 19:10:01 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int n,cer;
vector<int>v;
set<int>s;
int main()
{
fin>>n;
while(n--)
{
fin>>cer;
if(cer==1)
{
int x;
fin>>x;
s.insert(x);
v.push_back(x);
}
else if(cer==2)
{
int x;
fin>>x;
s.erase(v[x-1]);
}
else
fout<<*s.begin()<<endl;
}
return 0;
}