← All problemsSign in

Query Problem

Problem description. Given an array $A$ of length $N$ and $Q$ queries . There are two types of queries . Type $1$ query : $1$ $idx$ Type $2$ query ; $2$ $L$ $R$ For each query of type 1, you need to update value at $A[idx]$ to the largest divisor of $A[idx]$ which is smaller than $A[idx]$ . If $A[idx]$ is $1$ or a prime number then leave it as it is. For each query of type $2$ , you need to p

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start