SPOJ11469 SUBSET

题面

Farmer John’s owns N cows (2 <= N <= 20), where cow i produces M(i) units of milk each day (1 <= M(i) <= 100,000,000).

FJ wants to streamline the process of milking his cows every day, so he installs a brand new milking machine in his barn.

Unfortunately, the machine turns out to be far too sensitive: it only works properly if the cows on the left side of the

barn have the exact same total milk output as the cows on the right side of the barn!

Let us call a subset of cows “balanced” if it can be partitioned into two groups having equal milk output.

Since only a balanced subset of cows can make the milking machine work, FJ wonders how many subsets of his N cows are balanced.

Please help him compute this quantity.

有多少个非空子集,能划分成和相等的两份。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×