问题
found this question in geeksforgeeks related to dynamic programming with bitmasking : https://www.geeksforgeeks.org/sum-subsets-dynamic-programming/
I am trying for weeks but not able to understand how the answer is formulated. Please provide any links, that may help to understand the problem in a better manner or if possible kindly provide a better desciption/explaination.
The exact problem is as stated below :
Given an array of 2n integers, we need to calculate function F(x) = ∑Ai such that x&i==i for all x. i.e, i is a bitwise subset of x. i will be a bitwise subset of mask x, if x&i==i.
Some approaches to solve the problem is described in the geeksforgeeks link mentioned above but i'm not able to figure out how exactly it is being used.
来源:https://stackoverflow.com/questions/60656379/need-help-regarding-bitmaskdynamic-programming