← All problemsSign in

Array Filling

CodeChefRating 1887Open on judge ↗

You are given an array $A$ of size $N$. Initially, the array is filled with $0$-s. There are $M$ types of operations that you can perform on array $A$. The $i^{th}$ operation can be described by two integers $(x_i, y_i)$. In this operation, you choose a set of indices $S$ such that - $1 \leq j \leq N$, - $(j \bmod y_i) \neq 0$, - $A_j = 0$, , then you set $A_j = x_i$ for all $j \in S$. You

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