[algogeeks] Re: Dynamic Programming Problem SPOJ-AMR11A

2012-07-18 Thread Bharat Kul Ratan
If you need hint: I used DP (Dynamic Programming) to solve this and get AC (Accepted). I stored the matrix as 2-D array and then started with array[R][C]. From there I can go upward and left. In each element of array put the minimum possible value to get the array[R][C]. In case, if we get the

Re: [algogeeks] Syllogism

2011-08-23 Thread Bharat Kul Ratan
Statement: Some girls are beautiful IMO , this means you a set of all girls and after that comes statement about some otherwise statement would be for all girls. There is something left in the set after statement which is nothing but complement of beautiful i.e. not beautiful so, the conclusion

[algogeeks] Find the value of a(n)

2011-08-16 Thread Bharat Kul Ratan
Sequence *(ai)* of natural numbers is defined as follows: *ai = bi* (for *i = k*) *ai = c1ai-1 + c2ai-2 + ... + ckai-k* (for *i k*) where *bj* and *cj* are given natural numbers for *1=j=k*. We have to compute *an* for given *n* We've been given: *k* - number of elements of *(c)* and

Re: [algogeeks] Number theory

2011-08-16 Thread Bharat Kul Ratan
It might be useful: http://www.artofproblemsolving.com/Wiki/index.php/Partition_%28combinatorics%29 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit

Re: [algogeeks] Find the number of occurences of maximum sum in given array.

2011-08-15 Thread Bharat Kul Ratan
@sukran: I've gone through Kadane's algo but I was looking for the number of times the sum appears especially cases involving zeros. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit