Minimum size of array possible?

Правка en1, от Impostor_Syndrome, 2022-02-16 22:15:13

In an array — 'arr' there are n elements. Two elements arr[i] and arr[j] can be combined to one element if arr[i] >= k * arr[j], for i != j. After combination, these two elements cannot further combine with any other element of the array. Find the minimum size of the array possible, after executing atmost n/2 operations.

Input will be n, the array elements and k.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Impostor_Syndrome 2022-02-16 22:15:13 406 Initial revision (published)