Or login with:
| std::vector<int>unrank_combination( | int | m | |
| int | n | ||
| int | rank | ) |
#include <codecogs/maths/combinatorics/combinations/unrank_combination.h> #include <iostream> int main() { std::vector<int> comb = Maths::Combinatorics::Combinations::unrank_combination(6, 3, 10); std::cout << "Size of the combination: " << comb.size() << std::endl; for (int i = 0; i < comb.size(); i++) std::cout << comb[i] << " "; std::cout << std::endl; return 0; }Output:
Size of the combination: 3 1 5 6
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge