Mixture problem doubt

problem-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 is going to take two mixtures that stand next to each other and mix them together, and put the resulting mixture in their place.

When mixing two mixtures of colors a and b, the resulting mixture will have the color (a+b) mod 100.

Also, there will be some smoke in the process. The amount of smoke generated when mixing two mixtures of colors a and b is a*b.

Find out what is the minimum amount of smoke that Harry can get when mixing all the mixtures together.
You can find the original problem here.

Input Format
The first line of each input file will contain n, the number of mixtures. The second line will contain n integers between 0 and 99 - the initial colors of the mixtures.

Constraints
1 <= n <= 100

Output Format
Output the minimum amount of smoke.

Sample Input
3
40 60 20
Sample Output
2400

my solution - https://ide.codingblocks.com/s/125591 only two test case passed

You have used a wrong approach in your code, You have used one dimension dp array in your code, whereas the problem required 2-D dp array, so it would be better if you first go through the online video lecture explanation of the problem and then change your code accordingly.

there is no video related to this problem please explain algo
for this problem @yuktimutreja01

In which course you are enrolled ?

master c++ course mentor parteek bhaiya and sanket bhaiya and deepak agrawal bhaiya

Plz go to the dynamic programming section, and there you will find the video lecture Advanced Dp : Mixtures, study it and then make changes accordingly.