#include <algorithm>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <random>
#include <vector>
struct IsIncreasing {
bool operator()(const int& value) {
if (value >= last_selected_value) {
last_selected_value = value;
return true;
} else {
return false;
}
}
int last_selected_value = std::numeric_limits<int>::min();
};
int main() {
std::vector<int> values(100);
std::iota(values.begin(), values.end(), 1);
std::shuffle(values.begin(), values.end(), std::mt19937(2));
std::vector<int> selected_values;
std::copy_if(values.begin(), values.end(),
std::back_inserter(selected_values), IsIncreasing());
int count = 0;
for (auto value: selected_values) {
std::cout << std::setw(4) << value;
if (++count % 10 == 0) std::cout << std::endl;
}
std::cout << std::endl;
}