MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / main

Function main

test/test_generate_combinations.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19int main() {
20 vector<int> comb = {1, 3, 6};
21 vector<int> next = {1, 4, 5};
22 next_combination(comb, 6);
23 assert(next == comb);
24
25 string all = "123\n134\n234\n124\n145\n245\n345\n135\n235\n125\n";
26 Naive::all_combinations(5, 3);
27 assert(Naive::cout.str() == all);
28
29 string all2 = "345\n235\n234\n245\n125\n124\n123\n135\n134\n145\n";
30 Fast::all_combinations(5, 3);
31 assert(Fast::cout.str() == all2);
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected