Cod sursa(job #2865280)
| Utilizator | Data | 8 martie 2022 18:02:14 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
set<int>S;
queue<int>q;
int n;
int a[200005], cnt;
int main()
{
int x, op;
fin >> n;
while(n--)
{
fin >> op;
if(op == 1)
{
fin >> x;
S.insert(x);
a[++cnt] = x;
}
else if(op == 2)
{
fin >> x;
S.erase(a[x]);
}
else
{
for(auto i : S)
{
fout << i << "\n";
break;
}
}
}
return 0;
}
