HotashCoder's blog

By HotashCoder, history, 17 months ago, In English

You are given an array a which contains n elements. You can perform any number of operations. At each operation, you can select two indices i and j (where i != j), remove the elements a[i] and a[j] from the array, and insert their product, a[i] * a[j], into the array. Continue this process until the size of the array becomes 2.

You have to minimize the max(a,b), here a is the first element of the array and b is the second element of the array after completing the operation.

constrains: 0 < n < 100

Time limit: 5 sec

  • Vote: I like it
  • -2
  • Vote: I do not like it

| Write comment?