81#ifndef __ADS_KnapsackVariants
82 #define __ADS_KnapsackVariants
132std::pair< T , std::vector< std::size_t > >
161template<
class T ,
class V >
162std::pair< T , std::vector< std::size_t > >
186template<
class T ,
class V >
188 const std::vector< T > & v , V W );
210template<
class C = std::u
int64_t ,
class V >
230template<
class C = std::u
int64_t ,
class V >
264#include "ADS/optimization/impl/KnapsackVariants.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::pair< T, std::vector< std::size_t > > unboundedKnapsack(const std::vector< T > &p, const std::vector< V > &v, V C)
the largest profit of the objects of profits and volumes , each in unlimited supply,...
int minimumSquares(std::int64_t n)
the fewest squares of positive integers summing to
std::optional< T > minValueExactWeight(const std::vector< V > &w, const std::vector< T > &v, V W)
the least value of coins of weights and values , in unlimited supply, weighing exactly ; nothing if ...
std::pair< T, std::vector< std::size_t > > rodCutting(const std::vector< T > &price, std::size_t L)
the largest gain of a rod of length cut in pieces of lengths , , the price of a piece of length ,...
C coinChangeWays(const std::vector< V > &coins, V T)
the number of multisets of the coins of sum , each coin in unlimited supply; equal values in coins co...
C subsetSumCount(const std::vector< V > &A, V k)
the number of subsets of the places of whose items sum to