47 std::vector<std::vector<T>>
combine(
size_t k);
60 if (k > origin.size())
62 throw std::runtime_error(
"k must be smaller than elements number");
67 throw std::runtime_error(
"k must be greater than zero");
80 for (
size_t i = from; i <= origin.size() - k; ++i)
85 doCombine(i + 1, k - 1);
88 for (
auto ind: current) {
89 comb.push_back(origin[ind]);
91 combinations.push_back(comb);
unsigned int uint32_t
Definition: stdint.h:126
unsigned __int64 uint64_t
Definition: stdint.h:136