Hi, could any one explain the DP approach of this problem. http://community.topcoder.com/stat?c=problem_statement&pm=12750&rd=15703 I tried to solve using topdown approach but I was unable to implement. I want to discuss on both the approaches. Also please suggest some links to practice on similar problems.
Thanks in Advance.
Very straight forward DP problem.
First you need to calculate dp[S]: How many ways to form a team which has sum S.
When you are calculating the dp array, you need to choose the ith player who has skill[i] in decreasing order, when the conditions hold:
you can add
dp[ J - skill[i] ]
to your answer.could you please provide me some link which covers most of the straight forward dp problems..