Function ADS::halfSum

Function Documentation

inline long ADS::halfSum(const std::vector<long> &A)

half the sum, or -1 if the sum is odd (then no partition: the bound -1 has no YES in any of the three problems)

Pre:

A is not negative

Post:

-1 or half the sum