Deleting Array Again
You had an array $A$ of size $N$, and a cost array $C$ of size $N$. You will do exactly $N$ operations of the following type: - Choose $i$ such that $1 \le i \le |A|$, and then delete $A_i$ from the array $A$. - The associated cost of this operation is $A_i \times C_i$. - After each operation, the remaining parts of $A$ are concatenated and re-indexed from $1$ to $|A|$. Note that the array $C$
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