×

# How many subsets have the sum of x?

 0 Consider we have a set of n numbers, and we want to calculate the number of subsets in which the addition of all elements equal to x. Input first line has n, x and the next line contains n numbers of our set. In the output we have to calculate the number of subsets that have total sum of elements equal to x. INPUT 4 3 -1 2 4 2 OUTPUT 2  asked 19 Oct '15, 03:22 0★melotfi 36●1●2 accept rate: 50% constraints.?? (19 Oct '15, 12:01)

 0 answered 19 Oct '15, 13:25 469●6●30 accept rate: 7%
 0 array = [1] + [0] * (sum) pleas explain above? answered 04 Apr '16, 17:32 102●8 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×3,820
×801
×163
×74

question asked: 19 Oct '15, 03:22

question was seen: 3,167 times

last updated: 04 Apr '16, 17:32