The Most Amazing Dish
Chef has recently learnt about the most amazing dish. The recipe for this dish lists two sequences $A_1, A_2, \ldots, A_N$ and $B_1, B_2, \ldots, B_N$, and $Q$ tasks. Chef noticed that there are only three types of tasks: 1. `Z Y`: set $B_Z = Y$ 2. `L R X`: for each $i$ such that $L \le i \le R$, set $A_i = B_{X+i-L}$ 3. `L R`: compute the sum $A_L + A_{L+1} + \ldots + A_R$ Chef must perform all
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