Tap here to switch tabs
Problem
Submissions

Problem: Minimum Score Triangulation of Polygon

med
30 min
Try to solve the Minimum Score Triangulation of Polygon problem.

Statement

You are given a convex polygon with nn vertices, where the vertices are indexed sequentially in clockwise order from 00 to n−1n - 1. The value of each vertex ii is given by values[i].

A triangulation divides the polygon into n−2n - 2 triangles using nonintersecting diagonals. The score of a triangle formed by vertices ii, jj, and kk is the product values[i] ⋅\cdot values[j] ⋅\cdot values[k]. The total score of a triangulation is the sum of the scores of all its constituent triangles.

Return the minimum possible total score among all triangulations of the polygon.

Constraints:

  • n == values.length

  • 3≤3 \le n ≤50\le 50

  • 1≤1 \le values[i] ≤100\le 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Score Triangulation of Polygon

med
30 min
Try to solve the Minimum Score Triangulation of Polygon problem.

Statement

You are given a convex polygon with nn vertices, where the vertices are indexed sequentially in clockwise order from 00 to n−1n - 1. The value of each vertex ii is given by values[i].

A triangulation divides the polygon into n−2n - 2 triangles using nonintersecting diagonals. The score of a triangle formed by vertices ii, jj, and kk is the product values[i] ⋅\cdot values[j] ⋅\cdot values[k]. The total score of a triangulation is the sum of the scores of all its constituent triangles.

Return the minimum possible total score among all triangulations of the polygon.

Constraints:

  • n == values.length

  • 3≤3 \le n ≤50\le 50

  • 1≤1 \le values[i] ≤100\le 100