Multiple Change Sum
Given an array $A$ of length $N$. There is an integer variable $X$ and a score $S$. Initially, $X = 0$ and $S = 0$. You play the following single-player game on the array $A$ for the next $N$ seconds: - In the $t$-th second ($1 \le t \le N$), you **may** choose any index $i$ such that $1 \le i \le N$ and $t \mid i$ (i.e., $i$ is a multiple of $t$). - Then, update the score $S$ as follows:
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