• + 1 comment

    The problem statement is misleading and syntactically unclear. The definition of idx is incomplete — it says idx = (x ⊕ lastAnswer) but completely omits the necessary modulo operation % n.

    Additionally, the query syntax is confusing (e.g., 1 x y, 2 x y) and could be better explained as “a query consists of three integers: type, x, y”.