Array Queries
CodeChefOpen on judge ↗
Lily has an array $A[]$ of $N$ integers whose all elements are 0 initially. She wants you to perform $Q$ operations on it. Types of operations: - 1 X: Update the value of $A[X]$ to $2 * A[X] + 1$. - 2 X: Update the value $A[X]$ to $f ( A[x]/2 )$ , where $f$ is Greatest Integer Function. - 3 X Y: Take all the $A[i]$ such that $ X \leq i \leq Y $and convert them into their corresponding binary
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