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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

T-Primes Problem using Dynamic Programming

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

advertisement

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

advertisement

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

advertisement

Trigraphs Problem using Dynamic Programming

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

advertisement

Mixtures Problem using Dynamic Programming

This is a C++ Program that Solves Mixtures Problem using Dynamic Programming technique. Problem Description Harry Potter has n mixtures in front of him, arranged in a row. Each mixture has one of 100 different colors (colors have numbers from 0 to 99). He wants to mix all these mixtures together. At each step, he … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.