You are not logged in. Please login at www.codechef.com to post your questions!

×

How many subsets have the sum of x?

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

melotfi's gravatar image

0★melotfi
3612
accept rate: 50%

constraints.??

(19 Oct '15, 12:01) rachilies4★

link

answered 19 Oct '15, 13:25

anupam_datta's gravatar image

4★anupam_datta
469630
accept rate: 7%

array = [1] + [0] * (sum) pleas explain above?

link

answered 04 Apr '16, 17:32

ahmadreza1994's gravatar image

3★ahmadreza1994
1028
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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