← All problemsSign in

Recover The Array

CodeChefRating 3145Open on judge ↗

Let us define a special array as an array of **distinct natural** numbers such that the sum of any three elements is **not** divisible by $5$. Formally, let $A$ be an array of size $N$. Then, $A$ is a special array if the following conditions hold: 1) $A_i \in \mathbb{N} \;\;\;\; \forall \: 1 \leq i \leq N$; 2) $ A_i \neq A_j \;\;\; \forall \; 1 \leq i \neq j \leq N$; 3) $(A_i + A_j + A_k)$ $\%$

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