Expected Product
For a given array $A$ of length $N$, and a parameter $K$, we define $f(A, K)$ in the following way: - Consider a random experiment of the following type: - Repeat the following action $K$ times: choose an integer index $i$ uniformly at random from $[1, N]$, and update $A_i \leftarrow A_i + 1$. - After all $K$ updates, define $P = A_1 \times A_2 \times \ldots \times A_N$. - $f(A, K)$ is
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