Вот код:
Добавлено через 6 часов 30 минут
Актуально
Код:
typedef std::bitset < TOTAL_WEIGHT_HALF_MAX > T_weight_is_possible;
typedef std::multiset < int > T_weights;
bool may_decompose_weights_into_two_equal_piles( T_weights const & weights )
{
T_weight_is_possible weight_is_possible(1);
for( auto w_cur : weights )
{
weight_is_possible |= weight_is_possible << w_cur;
}
}
Актуально