Category: greedy algorithm
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array , the contiguous subarray has the largest …
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You …
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that …
This problem is from Timus Online Judge. The original problem description can be found here. There are k steaks that can be cooked at the same time. So …
The problem is from codeforces: http://codeforces.com/problemset/problem/298/B The note given in the problem description pretty much explains the problem clearly. In every moment, the ship can choose to stay put or …