## Blueberries Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Blueberries Problem using Dynamic Programming technique. Problem Description Teresa wants to pick up the blueberries in such a way that she may not exceed the limit proposed. When picking the blueberries, she noticed that if she pick from the bush i, she couldn’t pick the blueberries at the … Read more

## Assignments Problem – Dynamic Programming Solutions

This is a C++ Program that Solves the Assignments Problem using Dynamic Programming technique. Problem Description Your task will be to calculate number of different assignments of n different topics to n students such that everybody gets exactly one topic he likes. First line of input contains number of students n. Each of the next … Read more

## Bytelandian Gold Coins Problem – Dynamic Programming Solutions

This is a C++ Program that Solves the Bytelandian Gold Coins Problem using Dynamic Programming technique. Problem Description Each Bytelandian gold coin has an integer number written on it. A coin n can be exchanged in a bank into three coins: n/2, n/3 and n/4. But these numbers are all rounded down (the banks have … Read more

## Non Decreasing Digits Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Non Decreasing Digits Problem using Dynamic Programming technique. Problem Description A number is said to be made up of non-decreasing digits if all the digits to the left of any digit is less than or equal to that digit. For example, the four-digit number 1234 is composed of … Read more

## Cut Ribbon Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Cut the Ribbon Problem using Dynamic Programming technique. Problem Description Polycarpus has a ribbon, its length is n. He wants to cut the ribbon in a way that fulfils the following two conditions: After the cutting each ribbon piece should have length a, b or c. After the … Read more

## T-Primes Problem – Dynamic Programming Solutions

This is a C++ Program that Solves T Primes Problem using Dynamic Programming technique. Problem Description We know that prime numbers are positive integers that have exactly two distinct positive divisors. Similarly, we’ll call a positive integer t Т-prime, if t has exactly three distinct positive divisors. You are given an array of n positive … Read more

## Boredom Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Boredom Problem using Dynamic Programming technique. Problem Description Alex doesn’t like boredom. That’s why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it. Given a sequence a consisting of n integers. The player … Read more

## Army Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Army Problem using Dynamic Programming technique. Problem Description The Berland Armed Forces System consists of n ranks that are numbered using natural numbers from 1 to n, where 1 is the lowest rank and n is the highest rank. One needs exactly d[i] years to rise from rank … Read more

## Trigraphs Problem – Dynamic Programming Solutions

This is a C++ Program that Solves Trigraphs Problem using Dynamic Programming technique. Problem Description A tri-graph is an acyclic graph of (N >= 2) rows and exactly 3 columns. Unlike regular graphs, the costs in a tri-graph are associated with the vertices rather than the edges. The problem is to find the shortest path … Read more 