Equalize
CodeChefOpen on judge ↗
There is an array of size $N$. We have to make all the elements in the array equal. In one step you can select a particular index $idx$ from the array and do one of the following. - Replace $array[idx]$ by $array[idx]*x$ where $x$ is any prime number. - Replace $array[idx]$ by $array[idx]/y$ where $y$ is any prime divisor of $array[idx]$(if exists) Find out the minimum number of steps require
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start