, respectively. The matrices are ordered from left to right from 1 to
n. You are allowed to place brackets to prioritize some multiplications.
What is the minimum number of operations to multiply all the matrices?
When multiplying a
matrix, we perform
The first line contains a single integer
nlines contain the dimensions of each of the matrices
(1 ≤ ≤ 1000).
It’s guaranteed that
The program should print the minimum number of operations required to multiply all the matrices.
3 2 3 3 4 4 6
Time limit: 4.5 seconds
Memory limit: 512 MB
Output limit: 1 MB