Tap here to switch tabs
Problem
Submissions

Problem: Minimum Cost to Split into Ones

Try to solve the Minimum Cost to Split into Ones problem.

Statement

You are given an integer n. Starting with a single integer n, you repeatedly perform operations until all remaining values are equal to 11.

In one operation, you can select any current integer x that is strictly greater than 11 and split it into two positive integers a and b such that a ++ b == x. The cost of performing this split is a $ imes$ b.

Return the minimum total cost required to split n into all ones.

Constraints:

  • 1≤1 \leq n ≤500\leq 500

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Cost to Split into Ones

Try to solve the Minimum Cost to Split into Ones problem.

Statement

You are given an integer n. Starting with a single integer n, you repeatedly perform operations until all remaining values are equal to 11.

In one operation, you can select any current integer x that is strictly greater than 11 and split it into two positive integers a and b such that a ++ b == x. The cost of performing this split is a $ imes$ b.

Return the minimum total cost required to split n into all ones.

Constraints:

  • 1≤1 \leq n ≤500\leq 500