Pagini recente » Borderou de evaluare (job #1271882) | Cod sursa (job #670729) | Cod sursa (job #575570) | Cod sursa (job #2622481)
#include <fstream>
#include <vector>
#include <set>
int main() {
std::ifstream f("heapuri.in");
std::ofstream g("heapuri.out");
std::set<int> v;
std::vector<int> ord;
int command, n, tmp;
f >> n;
for (int i = 0; i < n; i++) {
f >> command;
if (command == 1) {
f >> tmp;
v.insert(tmp);
ord.push_back(tmp);
}
if (command == 2) {
f >> tmp;
v.erase(ord[tmp - 1]);
}
if (command == 3) {
g << *v.begin() << "\n";
}
}
}