Append Array
For a positive integer $x$, we define $f(x)$ to be the number of divisors of $x$ that have exactly one distinct prime factor. For example, $f(12) = 3$, since its divisors that satisfy the condition are $2, 3, $ and $4$. For an array $B$ of length $L \geq 2$, we define $$ g(B) = \left(\sum_{i=1}^L B_i \right) - \max_{1 \leq i \lt j \leq L} f(B_i \times B_j) $$ That is, $g(B)$ equals the sum of $B$
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